Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 76ac286

Browse files
author
Dean Sofer
committed
Added more legitimate logout behavior
1 parent 8df0ef0 commit 76ac286

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

modules/Auth/Auth.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ module.factory('Auth', ($q, $http) => {
1818
*/
1919
login(user, rememberMe = false) {
2020
return $http.post('/api/session', user);
21+
},
22+
/**
23+
* Take a wild guess what this does
24+
*/
25+
logout() {
26+
return $http.delete('/api/session');
2127
}
2228
}
2329
});

modules/Auth/Authenticated.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ module.config(function($stateProvider) {
2626
onEnter(user) {
2727
user.open();
2828
},
29-
onExit(user) {
29+
onExit(user, Auth) {
3030
user.close();
31+
Auth.logout();
3132
}
3233
});
3334
});

0 commit comments

Comments
 (0)