// Send a request to the login URL and save the returned JWT
login(context, creds, redirect) {
context.$http.post(LOGIN_URL, creds, (data) => {
localStorage.setItem('id_token', data.id_token)
this.user.authenticated = true
// Redirect to a specified route
if(redirect) {
router.go(redirect)
}
}).error((err) => {
context.error = err
})
},
alert( "Error" )
[1, 2].forEach(alert)