diff --git a/Tusker/Screens/Onboarding/OnboardingViewController.swift b/Tusker/Screens/Onboarding/OnboardingViewController.swift index fe13b67dd9..9b7750f82c 100644 --- a/Tusker/Screens/Onboarding/OnboardingViewController.swift +++ b/Tusker/Screens/Onboarding/OnboardingViewController.swift @@ -48,19 +48,17 @@ extension OnboardingViewController: InstanceSelectorTableViewControllerDelegate let mastodonController = MastodonController(instanceURL: instanceURL) mastodonController.registerApp { (clientID, clientSecret) in - let callbackURL = "tusker://oauth" - var components = URLComponents(url: instanceURL, resolvingAgainstBaseURL: false)! components.path = "/oauth/authorize" components.queryItems = [ URLQueryItem(name: "client_id", value: clientID), URLQueryItem(name: "response_type", value: "code"), URLQueryItem(name: "scope", value: "read write follow"), - URLQueryItem(name: "redirect_uri", value: callbackURL) + URLQueryItem(name: "redirect_uri", value: "tusker://oauth") ] let authorizeURL = components.url! - self.authenticationSession = ASWebAuthenticationSession(url: authorizeURL, callbackURLScheme: callbackURL) { url, error in + self.authenticationSession = ASWebAuthenticationSession(url: authorizeURL, callbackURLScheme: "tusker") { url, error in guard error == nil, let url = url, let components = URLComponents(url: url, resolvingAgainstBaseURL: true),