Skip to content
Snippets Groups Projects

[3.3.x] GoogleSignInAuthenticator: Request additional scope when signing in

1 file
+ 6
5
Compare changes
  • Side-by-side
  • Inline
@@ -4,7 +4,7 @@
* Copyright © 2022 VLC authors and VideoLAN
* Copyright © 2022 Videolabs
*
* Authors: Diogo Simao Marques <diogo.simaomarquespro@gmail.com>
* Authors: Diogo Simao Marques <dogo@videolabs.io>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
@@ -21,9 +21,10 @@ class GoogleSignInAuthenticator: NSObject {
@objc class func signIn(_ signIn: GIDSignIn, presentingView: VLCGoogleDriveTableViewController) {
let configuration = GIDConfiguration(clientID: kVLCGoogleDriveClientID)
signIn.addScopes([kGTLRAuthScopeDrive], presenting: presentingView, callback: nil)
signIn.signIn(with: configuration, presenting: presentingView, callback: { user, error in
signIn.signIn(with: configuration,
presenting: presentingView,
hint: nil,
additionalScopes: [kGTLRAuthScopeDrive]) { user, error in
if error != nil {
return
}
@@ -33,6 +34,6 @@ class GoogleSignInAuthenticator: NSObject {
grantedScopes.contains(kGTLRAuthScopeDrive) {
presentingView.setAuthorizerAndUpdate()
}
})
}
}
}
Loading