Remove AppAuth and prepare for Rust OIDC. (#870)

This commit is contained in:
Doug
2023-05-11 16:46:36 +01:00
committed by GitHub
parent a28e686c8d
commit 185710adf4
22 changed files with 249 additions and 264 deletions
@@ -159,6 +159,10 @@ class AppCoordinator: AppCoordinatorProtocol {
self.presentSplashScreen()
case (.restoringSession, .createdUserSession, .signedIn):
self.setupUserSession()
case (.signingOut, .signOut, .signingOut):
// We can ignore signOut when already in the process of signing out,
// such as the SDK sending an authError due to token invalidation.
break
case (_, .signOut(let isSoft), .signingOut):
self.logout(isSoft: isSoft)
case (.signingOut, .completedSigningOut(let isSoft), .signedOut):
@@ -336,7 +340,9 @@ class AppCoordinator: AppCoordinatorProtocol {
guard let self else { return }
switch callback {
case .didReceiveAuthError(let isSoftLogout):
self.stateMachine.processEvent(.signOut(isSoft: isSoftLogout))
stateMachine.processEvent(.signOut(isSoft: isSoftLogout))
case .updateRestorationToken:
userSessionStore.refreshRestorationToken(for: userSession)
default:
break
}
@@ -89,6 +89,17 @@ final class AppSettings {
/// The URL that is opened when tapping the Learn more button on the sliding sync alert during authentication.
let slidingSyncLearnMoreURL = URL(staticString: "https://github.com/matrix-org/sliding-sync/blob/main/docs/Landing.md")
/// The redirect URL used for OIDC.
let oidcRedirectURL = URL(staticString: "io.element:/callback")
/// The app's main URL shown when using OIDC.
let oidcClientURL = URL(staticString: "https://element.io")
/// The app's Terms of Service URL shown when using OIDC.
let oidcTermsURL = URL(staticString: "https://element.io/user-terms-of-service")
/// The app's Privacy Policy URL shown when using OIDC.
let oidcPolicyURL = URL(staticString: "https://element.io/privacy")
/// Any pre-defined static client registrations for OIDC issuers.
let oidcStaticRegistrations = [URL(staticString: "https://id.thirdroom.io/realms/thirdroom"): "elementx"]
// MARK: - Notifications
var pusherAppId: String {