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 {
|
do {
|
||||||
(clientID, clientSecret) = try await mastodonController.registerApp()
|
(clientID, clientSecret) = try await mastodonController.registerApp()
|
||||||
self.clientInfo = (instanceURL, clientID, clientSecret)
|
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 {
|
} catch {
|
||||||
throw Error.registeringApp(error)
|
throw Error.registeringApp(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let authCode = try await getAuthorizationCode(instanceURL: instanceURL, clientID: clientID)
|
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
|
let accessToken: String
|
||||||
do {
|
do {
|
||||||
accessToken = try await mastodonController.authorize(authorizationCode: authCode)
|
accessToken = try await mastodonController.authorize(authorizationCode: authCode)
|
||||||
|
if instanceURL.host == "mastodon.social" {
|
||||||
|
try await Task.sleep(nanoseconds: 2 * NSEC_PER_SEC)
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
throw Error.gettingAccessToken(error)
|
throw Error.gettingAccessToken(error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue