Skip to content

Commit

Permalink
logout notification
Browse files Browse the repository at this point in the history
  • Loading branch information
anindya-dhruba committed Jan 7, 2018
1 parent 74a54ba commit a4b4d47
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthenticateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function authenticate(Request $request)

try {
if(!$token = JWTAuth::attempt($credentials)) {
return response()->json(['error' => 'Invalid Login Credential'], 401);
return response()->json(['error' => 'Invalid login credential'], 401);
}
} catch(JWTException $e) {
return response()->json(['error' => 'Could not create token'], 500);
Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Vue.use(VueNoty, {
progressBar: false,
layout: 'bottomRight',
theme: 'bootstrap-v3',
timeout: 5000
timeout: 3000
});

import router from './router';
Expand Down
5 changes: 4 additions & 1 deletion resources/assets/js/components/shared/TopMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
logout() {
jwtToken.removeToken();
this.$store.dispatch('unsetAuthUser')
.then(() => this.$router.push({name: 'login'}));
.then(() => {
this.$noty.success('You are logged out');
this.$router.push({name: 'login'});
});
}
}
}
Expand Down

0 comments on commit a4b4d47

Please sign in to comment.