resources/assets/js/components/auth/index.js
// Send a request to the login URL and save the returned JWT
Send a request to the login URL and save the returned JWT
Send a request to the login URL and save the returned JWT
login(creds, redirect) {
    axios.post(LOGIN_URL, {
      email: creds.email,
      password: creds.password
    }).then((response) => {
      localStorage.setItem('access_token', response.access_token);
      console.log(response.data);
      this.user.authenticated = true;
      if(redirect) {
        router.push(redirect);
      }
    }).catch((error) => {
      console.log(error);
    });
  }
login ( creds , redirect ) { axios . post ( LOGIN_URL , { email : creds . email , password : creds . password } ) . then ( ( response ) => { localStorage . setItem ( 'access_token' , response . access_token ) ; console . log ( response . data ) ; this . user . authenticated = true ; if ( redirect ) { router . push ( redirect ) ; } } ) . catch ( ( error ) => { console . log ( error ) ; } ) ; }
Send a request to the login URL and save the returned JWT
Send a request to the login URL and save the returned JWT
//localStorage.setItem('scope', response.scope);