Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commite96764d

Browse files
committed
Update scopes check code sample
The customer in#820 was trying to clarify when they should do the "scopes check" we suggest. I updated the code sample to be within the callback which I hope clarifies the flow a bit.cc@github/platform @github/docs-platform
1 parent268d647 commite96764d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎content/guides/basics-of-authentication.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,15 @@ The scopes that were granted are returned as a part of the response from
125125
exchanging a token.
126126

127127
#!ruby
128-
# check if we were granted user:email scope
129-
scopes = JSON.parse(result)['scope'].split(',')
130-
has_user_email_scope = scopes.include? 'user:email'
128+
get '/callback' do
129+
# ...
130+
# Get the access_token using the code sample above
131+
# ...
132+
133+
# check if we were granted user:email scope
134+
scopes = JSON.parse(result)['scope'].split(',')
135+
has_user_email_scope = scopes.include? 'user:email'
136+
end
131137

132138
In our application, we're using`scopes.include?` to check if we were granted
133139
the`user:email` scope needed for fetching the authenticated user's private

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp