Created
November 10, 2017 17:45
-
-
Save quiaro/b4c4bb9cb91cae04213e0b2cb367bdce to your computer and use it in GitHub Desktop.
Authenticate via Auth0 Authentication API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import auth0 from 'auth0-js'; | |
| const CLIENT_DOMAIN = '__AUTH0_DOMAIN__'; | |
| const CLIENT_ID = '__AUTH0_CLIENT_ID__'; | |
| const SCOPE = 'openid'; | |
| const REDIRECT = 'http://localhost:3000/callback'; | |
| const auth = new auth0.WebAuth({ | |
| domain: CLIENT_DOMAIN, | |
| clientID: CLIENT_ID, | |
| }); | |
| export function login() { | |
| auth.authorize({ | |
| responseType: 'token', | |
| redirectUri: REDIRECT, | |
| scope: SCOPE, | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment