Skip to content

Commit 2ab8461

Browse files
Merge pull request #59 from AlexJF/directive-update-expired
Act on token expiration by deleting token and updating directive UI.
2 parents 097e9b3 + cc3b644 commit 2ab8461

File tree

2 files changed

+187
-181
lines changed

2 files changed

+187
-181
lines changed

app/scripts/directives/oauth.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ directives.directive('oauth', function(AccessToken, Endpoint, Profile, $location
7979
loggedOut();
8080
};
8181

82+
scope.$on('oauth:expired', function() {
83+
AccessToken.destroy(scope);
84+
scope.show = 'logged-out';
85+
});
86+
8287
// user is authorized
8388
var authorized = function() {
8489
$rootScope.$broadcast('oauth:authorized', AccessToken.get());

0 commit comments

Comments
 (0)