Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include the received token's scope in the 'extra' hash
According to [GitHub's documentation](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#requested-scopes-and-granted-scopes): > The scope attribute lists scopes attached to the token that were granted > by the user. Normally, these scopes will be identical to what you > requested. However, users can edit their scopes, effectively granting > your application less access than you originally requested. Also, users > can edit token scopes after the OAuth flow is completed. You should be > aware of this possibility and adjust your application's behavior > accordingly. Therefore, include the scope returned with the OAuth token in the 'extra' hash generated for the omniauth callback. According to the OAuth2 gem's code, extra params returned with the access token response can accessed via indexing on the AccessToken class: https://github.com/oauth-xx/oauth2/blob/58471c95c5473d9a494e45534df96f0cf935a2bb/lib/oauth2/access_token.rb#L60-L65
- Loading branch information