summaryrefslogtreecommitdiffstats
path: root/components/LoginAuth0.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2017-10-27 13:24:41 -0400
committerWes Bos <wesbos@gmail.com>2017-10-27 13:24:41 -0400
commit0f1b9240bbd05b377e868faf78b89b509a3d7537 (patch)
tree1974b4d5a59f1843f64789b5536c32606a097ba0 /components/LoginAuth0.js
parentacdfa2840f867e686471a8e9ac3f29353fab7dd1 (diff)
ayeee
Diffstat (limited to 'components/LoginAuth0.js')
-rw-r--r--components/LoginAuth0.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/components/LoginAuth0.js b/components/LoginAuth0.js
index 8691e82..b55ae4a 100644
--- a/components/LoginAuth0.js
+++ b/components/LoginAuth0.js
@@ -7,8 +7,8 @@ class LoginAuth0 extends Component {
constructor(props) {
super(props);
if (typeof window === 'undefined') return;
- const redirectUrl = `http://localhost:6969/signup`;
- this._lock = new Auth0Lock('l851ev2q8X48wf56eGLjIWFbMwwbvWPE', 'wesbos.auth0.com', {
+ const redirectUrl = `http://localhost:3000/signup`;
+ this._lock = new Auth0Lock('r6D64Waoq7roAnv8GT04dnn1tpq9PAqu', 'wesbos.auth0.com', {
auth: {
redirect: false,
},
@@ -16,11 +16,17 @@ class LoginAuth0 extends Component {
}
componentDidMount() {
- console.log('MOUNT');
this._lock.on('authenticated', authResult => {
+ console.log(authResult);
window.localStorage.setItem('auth0IdToken', authResult.idToken);
+ console.log('Im baaaack!');
this.props.currentUserQuery.refetch();
});
+
+ this._lock.on('authorization_error', err => {
+ console.error(err);
+ });
+
// refech on page load because of the server render
this.props.currentUserQuery.refetch();
}