Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jacobsapps/c2c74f40cbfaeb55f59c9fcd8e70af98 to your computer and use it in GitHub Desktop.
Save jacobsapps/c2c74f40cbfaeb55f59c9fcd8e70af98 to your computer and use it in GitHub Desktop.
Auth Actor 1
actor AuthService {
func getAuthToken() async throws -> String {
if let localToken = getLocalToken(),
!localToken.isExpired {
return localToken
}
return try await refreshAuthToken()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment