Workaround for issues signing in to m.s
This commit is contained in:
parent
125f91257a
commit
8b546daeaa
|
@ -51,14 +51,25 @@ class OnboardingViewController: UINavigationController {
|
|||
do {
|
||||
(clientID, clientSecret) = try await mastodonController.registerApp()
|
||||
self.clientInfo = (instanceURL, clientID, clientSecret)
|
||||
// m.s has problems with (I think) the read replicas not updating fast enough
|
||||
// so give it some more time to propagate, and prevent invalid_client/etc. errors
|
||||
if instanceURL.host == "mastodon.social" {
|
||||
try await Task.sleep(nanoseconds: 2 * NSEC_PER_SEC)
|
||||
}
|
||||
} catch {
|
||||
throw Error.registeringApp(error)
|
||||
}
|
||||
}
|
||||
let authCode = try await getAuthorizationCode(instanceURL: instanceURL, clientID: clientID)
|
||||
if instanceURL.host == "mastodon.social" {
|
||||
try await Task.sleep(nanoseconds: 2 * NSEC_PER_SEC)
|
||||
}
|
||||
let accessToken: String
|
||||
do {
|
||||
accessToken = try await mastodonController.authorize(authorizationCode: authCode)
|
||||
if instanceURL.host == "mastodon.social" {
|
||||
try await Task.sleep(nanoseconds: 2 * NSEC_PER_SEC)
|
||||
}
|
||||
} catch {
|
||||
throw Error.gettingAccessToken(error)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue