Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add additional scopes request #167

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

reslear
Copy link
Collaborator

@reslear reslear commented Jan 4, 2022

Feature for simple request adding/removing additional scopes already authorised user

addScopes

  • ts types
  • Web
  • Android
  • iOS
  • docs

removeScopes

  • ts types
  • Web
  • Android
  • iOS
  • docs

closes: #158

@reslear reslear changed the title feature: add additional scopes request feat: add additional scopes request Jan 4, 2022
@reslear
Copy link
Collaborator Author

reslear commented Jan 4, 2022

hi @joeflateau need you help with this, and is need sponsoring you work)
separate function from

self.googleSignIn.addScopes(self.additionalScopes, presenting: presentingVc) { user, error in
if let error = error {
self.signInCall?.reject(error.localizedDescription);
return;
}
self.resolveSignInCallWith(user: user!);
}

@joeflateau
Copy link
Contributor

@reslear agree it would be good to add the "addScope" function, but I don't believe that would close #158, they seem unrelated.

@reslear
Copy link
Collaborator Author

reslear commented Jan 5, 2022

@joeflateau #158 is example, but in my case need get google contacts from address book

In my onboarding screen app, login with google is required, is i'm set scopes

['profile', 'email', 'openid', 'https://www.googleapis.com/auth/contacts.readonly']

most people don't share contacts and leave the app 😨

but if we logged in a user with default areas ['profile', 'email', 'openid'], and somewhere in the application we made an optional button to share contacts

async function getContacts() { 
  
  // TODO: maybe need add checkScopes ?
  await GoogleAuth.addScopes([
    'https://www.googleapis.com/auth/contacts.readonly'
  ])

  const { result } = await gapi.client.people.people.connections.list({
     'resourceName': 'people/me',
     'personFields': 'names',
   })
   
   return result.connections.map((person) => person.names[0].displayName)
}

@reslear
Copy link
Collaborator Author

reslear commented Jan 7, 2022

@reslear
Copy link
Collaborator Author

reslear commented Feb 1, 2022

@hoi4 maybe you help for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to use birthday scope?
3 participants