Open jamietanna opened 6 years ago
@jamietanna thanks for you submission! I would love to take this one step further with an example. Maybe something like this (untested)?
fetchUserProfile: [
'function(accessToken, ctx, cb) {',
' // TODO: call OAuth2 API with the `accessToken` and set the user\'s `profile`',
' var url = 'https://oauth2provider.com/oauth/authorize; // replace with actual url',
' request.get(url, {',
' headers: { Authorization: \'Bearer \' + accessToken }',
' json: true',
' }, function(err, resp, profile) {',
' if (err) return cb(err);',
' if (resp.statusCode !== 200) return cb(new Error('StatusCode: ' + resp.statusCode));',
' profile.user_id = profile.id;',
' cb(null, profile);',
' });',
'}'
].join('\n')
Great idea @fyockm, I'll try and update with a better example this weekend!
@jamietanna are you still interested in updating this PR?
Apologies @fyockm, I've amended now :+1:
π hey @jamietanna! great to see you come back to this PR. thanks for updating- the change LGTM.
that said, ownership of this repo has changed here at Auth0 and have alerted the new team.
βοΈ Changes
Improve example code for
fetchUserProfile
stubprofile
objectTODO
to make it more obvious it's not implementedOAuth2
and add space afterAPI
π· Screenshots
If there were visual changes to the application with this change, please include before and after screenshots here. If it has animation, please use screen capture software like to make a gif.
π References
N/A
π― Testing
Custom Social Connections
+ New Connection
Fetch User Profile Script
is set to the updated valueπ Deployment
This change can be merged at any time.
π‘ Rollout
In order to verify that the deployment was successful we will need to verify that the example code is created as per steps in Testing.
π₯ Rollback
We will rollback if the changes introduce breaking JavaScript example code.
π Procedure
This will be done via a
git revert
on the merge commit that introduces this changes.π₯ Appliance
Note to reviewers: ensure that this change is compatible with the Appliance.