fix: cache with outdated data

This commit is contained in:
Divlo
2022-08-30 18:42:21 +02:00
parent 66f3e0475f
commit 6cfee0f6a3
5 changed files with 11 additions and 11 deletions

View File

@ -5,6 +5,7 @@ import { API_URL } from '../api'
import { cookies } from '../cookies'
import { Tokens } from '.'
import { fetchRefreshToken } from './authenticationFromServerSide'
import { clearCache } from '../cache'
export class Authentication {
public tokens: Tokens
@ -99,7 +100,7 @@ export class Authentication {
public signout(): void {
cookies.remove('refreshToken')
window.localStorage.clear()
clearCache()
window.location.href = '/authentication/signin'
}
@ -120,6 +121,7 @@ export class Authentication {
}
public signin(): void {
clearCache()
cookies.set('refreshToken', this.tokens.refreshToken)
}
}