You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
592 B

const TOKEN_KEY = 'access_token'
const REFRESH_TOKEN_KEY = 'refresh_token'
class TokenService {
getToken() {
return localStorage.getItem(TOKEN_KEY)
}
saveToken(accessToken) {
localStorage.setItem(TOKEN_KEY, accessToken)
}
removeToken() {
localStorage.removeItem(TOKEN_KEY)
}
getRefreshToken() {
return localStorage.getItem(REFRESH_TOKEN_KEY)
}
saveRefreshToken(refreshToken) {
localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken)
}
removeRefreshToken() {
localStorage.removeItem(REFRESH_TOKEN_KEY)
}
}
export default new TokenService()