Skip to content

Commit

Permalink
logout
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdias committed Dec 22, 2016
1 parent aa1664e commit ce640d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/common/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ onMessage((request, sender, sendResponse) => {
manager.kitsu.login(request.username, request.password)
return
}
if (request.action == 'logout') {
manager.kitsu.logout()
return
}
if (request.action == 'user') {
manager.kitsu.getUser().then((user) => {
sendResponse(user)
Expand Down
3 changes: 1 addition & 2 deletions src/common/js/kitsu.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ class Kitsu {
})
}

logout(callback) {
logout() {
localStorage.removeItem('id')
localStorage.removeItem('username')
localStorage.removeItem('token')
localStorage.removeItem('refresh')
callback()
}

refresh(token, refresh) {
Expand Down

0 comments on commit ce640d8

Please sign in to comment.