Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove @_spi(Experimental) from signInWithIdToken #68

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Examples/Shared/Sources/SignInWithAppleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@

import AuthenticationServices
import CryptoKit
import GoTrue
import SwiftUI
@_spi(Experimental) import GoTrue

struct SignInWithAppleView: View {
@Environment(\.goTrueClient) private var client
@State var nonce: String?

var body: some View {
SignInWithAppleButton { request in
// self.nonce = sha256(randomString())
// request.nonce = nonce
let nonce = randomString()
self.nonce = nonce
request.nonce = sha256(nonce)
request.requestedScopes = [.email, .fullName]
} onCompletion: { result in
Task {
Expand All @@ -36,8 +37,8 @@ struct SignInWithAppleView: View {
try await client.signInWithIdToken(
credentials: .init(
provider: .apple,
idToken: idToken/*,
nonce: self.nonce*/
idToken: idToken,
nonce: nonce
)
)
} catch {
Expand Down
1 change: 0 additions & 1 deletion Sources/GoTrue/GoTrueClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ public final class GoTrueClient {

/// Allows signing in with an ID token issued by certain supported providers.
/// The ID token is verified for validity and a new session is established.
@_spi(Experimental)
@discardableResult
public func signInWithIdToken(credentials: OpenIDConnectCredentials) async throws -> Session {
try await _signIn(
Expand Down
2 changes: 1 addition & 1 deletion Sources/GoTrue/Types.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public enum AnyJSON: Hashable, Codable, Sendable {
} else if let number = try? container.decode(Double.self) {
self = .number(number)
} else if container.decodeNil() {
self = .null
self = .null
} else {
throw DecodingError.dataCorrupted(
.init(codingPath: decoder.codingPath, debugDescription: "Invalid JSON value.")
Expand Down
2 changes: 1 addition & 1 deletion Tests/GoTrueTests/GoTrueTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Mocker
import XCTest

@testable @_spi(Experimental) import GoTrue
@testable import GoTrue

final class InMemoryLocalStorage: GoTrueLocalStorage, @unchecked Sendable {
private let queue = DispatchQueue(label: "InMemoryLocalStorage")
Expand Down