|
@@ -144,11 +144,12 @@ final class GoogleOAuthService: NSObject {
|
|
|
URLQueryItem(name: "redirect_uri", value: redirectURI),
|
|
URLQueryItem(name: "redirect_uri", value: redirectURI),
|
|
|
URLQueryItem(name: "response_type", value: "code"),
|
|
URLQueryItem(name: "response_type", value: "code"),
|
|
|
URLQueryItem(name: "scope", value: scopes.joined(separator: " ")),
|
|
URLQueryItem(name: "scope", value: scopes.joined(separator: " ")),
|
|
|
|
|
+ // Reuse already granted scopes so users are not repeatedly asked.
|
|
|
|
|
+ URLQueryItem(name: "include_granted_scopes", value: "true"),
|
|
|
URLQueryItem(name: "state", value: state),
|
|
URLQueryItem(name: "state", value: state),
|
|
|
URLQueryItem(name: "code_challenge", value: codeChallenge),
|
|
URLQueryItem(name: "code_challenge", value: codeChallenge),
|
|
|
URLQueryItem(name: "code_challenge_method", value: "S256"),
|
|
URLQueryItem(name: "code_challenge_method", value: "S256"),
|
|
|
- URLQueryItem(name: "access_type", value: "offline"),
|
|
|
|
|
- URLQueryItem(name: "prompt", value: "consent")
|
|
|
|
|
|
|
+ URLQueryItem(name: "access_type", value: "offline")
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
guard let authURL = components.url else { throw GoogleOAuthError.invalidCallbackURL }
|
|
guard let authURL = components.url else { throw GoogleOAuthError.invalidCallbackURL }
|