generated from element-hq/.github
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#40: Remove SSO and replace fallback with OIDC.
- Loading branch information
Showing
17 changed files
with
149 additions
and
377 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Client.swift | ||
// ElementX | ||
// | ||
// Created by Doug on 17/06/2022. | ||
// Copyright © 2022 Element. All rights reserved. | ||
// | ||
|
||
import MatrixRustSDK | ||
|
||
extension Client { | ||
static func new(_ address: String) throws -> Client { | ||
do { | ||
return try discoverClient(domain: address) | ||
} catch { | ||
return try newClient(homeserver: HomeserverAddress.sanitized(address)) | ||
} | ||
} | ||
|
||
func loginMode() -> LoginMode { | ||
if let authenticationServer = authenticationServer(), let url = URL(string: authenticationServer) { | ||
return .oidc(url) | ||
} else if (try? supportsPasswordLogin()) == true { | ||
return .password | ||
} else { | ||
return .unsupported | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.