Created
April 8, 2025 16:43
-
-
Save jacobsapps/c2c74f40cbfaeb55f59c9fcd8e70af98 to your computer and use it in GitHub Desktop.
Auth Actor 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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