Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shilgapira committed Dec 17, 2023
1 parent 47c6410 commit d1206d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/internal/routes/OAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OAuth: Route, DescopeOAuth {
let startResponse = try await client.oauthNativeStart(provider: provider, refreshJwt: refreshJwt, options: loginOptions)

if startResponse.clientId != Bundle.main.bundleIdentifier {
log(.debug, "Sign in with Apple requires an OAuth provider that's configured with a clientId matching the application's bundle identifier", startResponse.clientId, Bundle.main.bundleIdentifier)
log(.error, "Sign in with Apple requires an OAuth provider that's configured with a clientId matching the application's bundle identifier", startResponse.clientId, Bundle.main.bundleIdentifier)
throw DescopeError.oauthNativeFailed.with(message: "OAuth provider clientId doesn't match bundle identifier")
}

Expand Down Expand Up @@ -76,7 +76,7 @@ class OAuth: Route, DescopeOAuth {
}

private func parseCredential(_ credential: ASAuthorizationCredential, implicit: Bool) throws -> (authorizationCode: String?, identityToken: String?, user: String?) {
guard let credential = credential as? ASAuthorizationAppleIDCredential else { throw DescopeError.oauthNativeFailed.with(message: "Invalid oauth credential type") }
guard let credential = credential as? ASAuthorizationAppleIDCredential else { throw DescopeError.oauthNativeFailed.with(message: "Invalid Apple credential type") }
log(.debug, "Received Apple credential", credential.realUserStatus)

var authorizationCode: String?
Expand Down
8 changes: 4 additions & 4 deletions src/sdk/Routes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,10 @@ public protocol DescopeOAuth {

/// Authenticates the user using the native `Sign in with Apple` dialog.
///
/// This API enables a more streamlined authentication flow than the equivalent
/// browser-based OAuth flow using the `.apple` provider. The authentication presents
/// a native dialog that lets the user sign in with the Apple ID they're already
/// using on their device.
/// This API enables a more streamlined user experience than the equivalent browser
/// based OAuth authentication, when using the `.apple` provider or a custom provider
/// that's configured for Apple. The authentication presents a native dialog that lets
/// the user sign in with the Apple ID they're already using on their device.
///
/// The Sign in with Apple APIs require some setup in your Xcode project, including
/// at the very least adding the `Sign in with Apple` capability. You will also need
Expand Down

0 comments on commit d1206d6

Please sign in to comment.