Skip to content

Commit

Permalink
Added logout action (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: Puneet Aggarwal <[email protected]>
  • Loading branch information
puneet222 and Puneet Aggarwal authored Mar 19, 2021
1 parent 8936829 commit 970d27d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/actions/get_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { accessToken } from '../utils/constants'
const returnOptions = () => {
if (!accessToken) {
return JSON.stringify({
remove: ['search', 'orgs'],
remove: ['search', 'orgs', 'logout'],
})
} else {
return JSON.stringify({
Expand Down
9 changes: 9 additions & 0 deletions src/actions/logout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @description Logout from github automation package
setVars([
{
name: 'accessToken',
value: '',
},
], { local: true })
notify('Access token removedd successfully', 'success', 3000)
reIndex([])
2 changes: 1 addition & 1 deletion src/actions/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (currentUrl.indexOf('login') === -1) {
},
], { local: true })
notify('Access token added successfully', 'success', 3000)
reIndex()
reIndex([])
}
} else {
notify('Please login into your github account first', 'error', 3000)
Expand Down

0 comments on commit 970d27d

Please sign in to comment.