Skip to content

Commit

Permalink
add switch to auth service to disble auth
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Burgess committed Oct 4, 2021
1 parent e007b9a commit d931ae1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utils/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ const loginWithAuth = () => {
redirect_uri: window.location.origin + '/login'
}).then(token => {
auth0.getUser().then(user => {
console.log(user);
console.log(user, token);
});
});
}

export default function user() {
const authOn = process.env.AUTH_ENABLED === 1
return {
authenticated: window.localStorage.getItem('jwt_token'),
authenticated: authOn ? window.localStorage.getItem('jwt_token') : true,
login() {
loginWithAuth()
authOn ? loginWithAuth() : router.resolve('/')
},
logout() {
window.localStorage.removeItem('jwt_token')
Expand Down

0 comments on commit d931ae1

Please sign in to comment.