Skip to content

Instantly share code, notes, and snippets.

@fruchtose
Created November 24, 2012 02:49
Show Gist options
  • Save fruchtose/4138167 to your computer and use it in GitHub Desktop.
Save fruchtose/4138167 to your computer and use it in GitHub Desktop.
Everyauth OAuth 2 submodule sequences
var weibo = module.exports =
oauthModule.submodule('weibo')
// ...
.get('entryPath',
'the link a user follows, whereupon you redirect them to the 3rd party OAuth provider dialog - e.g., "/auth/facebook"')
// ...
.get('callbackPath',
'the callback path that the 3rd party OAuth provider redirects to after an OAuth authorization result - e.g., "/auth/facebook/callback"')
// ...
.step('fetchOAuthUser')
.accepts('accessToken')
.promises('oauthUser')
// ...
.stepseq('authCallbackErrorSteps')
.step('handleAuthCallbackError',
'a request handler that intercepts a failed authorization message sent from the OAuth2 provider to your service. e.g., the request handler for "/auth/facebook/callback?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request."')
.accepts('req res next')
.promises(null)
// End of oauth2 sequence definitions
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment