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
| // | |
| // printUserDefaultsKeys.swift | |
| // | |
| import Foundation | |
| fileprivate let appGroupIdentifier = "group.com.my.app" | |
| func printUserDefaultsKeys() { | |
| print("Keys in standard UserDefaults:") |
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
| // | |
| // AuthStateRepository.swift | |
| // | |
| import Foundation | |
| import AppAuth | |
| protocol AuthStateRepository: AnyObject { | |
| var state: OIDAuthState? { get } | |
| func persist(state: OIDAuthState) throws |
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
| // | |
| // KeychainAuthStateRepository.swift | |
| // | |
| import Foundation | |
| import Security | |
| import AppAuth | |
| /** | |
| Using the keychain to manage user secrets: |
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
| // | |
| // AuthService.swift | |
| // | |
| import Foundation | |
| enum AuthError: Error { | |
| case missingConfiguration | |
| case notAuthenticated | |
| case failedToPersistState |
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
| // | |
| // Auth0AuthService.swift | |
| // | |
| import Foundation | |
| import AppAuth | |
| struct Auth0Configuration { | |
| let openIdDomain: String | |
| let openIdClientId: String |
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
| // | |
| // AuthTokenProvider.swift | |
| // | |
| import Foundation | |
| protocol AuthTokenProvider: AnyObject { | |
| func performWithFreshToken(_ action: @escaping (Result<String, Error>) -> Void) | |
| } |
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
| // | |
| // Auth0AuthService+AuthTokenProvider.swift | |
| // | |
| import Foundation | |
| import AppAuth | |
| extension Auth0AuthService: AuthTokenProvider { | |
| func performWithFreshToken(_ action: @escaping (Result<String, Error>) -> Void) { | |
| guard let authState = authStateRepository.state else { |
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
| // | |
| // WidgetAuthTokenProvider.swift | |
| // | |
| import Foundation | |
| final class WidgetAuthTokenProvider: AuthTokenProvider { | |
| private let authStateRepository: AuthStateRepository | |
| init(authStateRepository: AuthStateRepository) { |
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
| // | |
| // ViewController.swift | |
| // | |
| import UIKit | |
| import TinyConstraints | |
| enum TextType { | |
| case info | |
| case error |