Skip to content

Commit

Permalink
Remove checkAuthentication method (Apple)
Browse files Browse the repository at this point in the history
  • Loading branch information
yllfejziu committed May 15, 2024
1 parent 14ef45e commit 986a211
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
5 changes: 0 additions & 5 deletions Resources/Apple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ let result = try await authenticator
// get authentication status
let status = authenticator.isAuthenticated

// check authentication status
// we should check this when we need to explicitly query authenticator to check if authenticated
let isAuthenticated = try await authenticator
.checkAuthentication()

// signOut user
authenticator.signOut() // all provider data regarding the use auth is cleared at this point
```
10 changes: 0 additions & 10 deletions Sources/Apple/AppleAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ extension AppleAuthenticator: Authenticator {
public var isAuthenticated: Authenticated {
storage.string(forKey: storageUserIdKey) != nil && storage.bool(forKey: storageAuthenticatedKey)
}

/// Checks the current auth state and returns the boolean value asynchronously.
public func checkAuthentication() async -> Authenticated {
guard let userId = storage.string(forKey: storageUserIdKey) else {
return false
}

let credentialState = try? await ASAuthorizationAppleIDProvider().credentialState(forUserID: userId)
return credentialState == .authorized
}

/// Boolean if given `url` should be handled.
///
Expand Down

0 comments on commit 986a211

Please sign in to comment.