Skip to content

Commit 206bef3

Browse files
committed
Change isAuthenticated() method to check if token is also expired.
1 parent c26fc50 commit 206bef3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/Core/Account.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ public extension InPlayer {
3636
}
3737

3838
/**
39-
Check if current user has access token.
39+
Check if current user has valid access token.
4040
- Returns: Bool result of the check.
4141
*/
4242
public static func isAuthenticated() -> Bool {
4343
guard let credentials = getCredentials() else { return false }
44+
guard Date().timeIntervalSince1970.isLess(than: credentials.expires) else { return false }
4445
return !credentials.accessToken.isEmpty && credentials.accessToken != ""
4546
}
4647

0 commit comments

Comments
 (0)