Skip to content

Commit

Permalink
change token key in localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
tinohager committed Dec 6, 2023
1 parent 9a5ad30 commit 0001aca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<html>
<head>
<title>Nager.AuthenticationService</title>
<title>place holder</title>
</head>
<body>
add spa
replace by ci/cd build
</body>
</html>
8 changes: 5 additions & 3 deletions src/Frontend/src/helpers/tokenHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ import { date, LocalStorage } from 'quasar'
import { AuthenticationResponse } from 'src/models/AuthenticationResponse'
import { TokenInfo } from 'src/models/TokenInfo'

const authenticationTokenKey = 'authenticationToken'

function getToken () : string | null {
return LocalStorage.getItem<string>('token')
return LocalStorage.getItem<string>(authenticationTokenKey)
}

function setToken (authenticationResponse : AuthenticationResponse) {
LocalStorage.set('token', authenticationResponse.token)
LocalStorage.set(authenticationTokenKey, authenticationResponse.token)
}

function removeToken () {
return LocalStorage.remove('token')
return LocalStorage.remove(authenticationTokenKey)
}

function parseToken (token: string) : TokenInfo | undefined {
Expand Down

0 comments on commit 0001aca

Please sign in to comment.