mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
fix: handle refresh token error
This commit is contained in:
parent
d8c802aa20
commit
926c4d6f2a
|
@ -26,13 +26,18 @@ const SwrInitor = ({
|
|||
router.replace('/signin')
|
||||
return
|
||||
}
|
||||
if (consoleTokenFromLocalStorage && refreshTokenFromLocalStorage)
|
||||
getNewAccessToken(consoleTokenFromLocalStorage, refreshTokenFromLocalStorage)
|
||||
if (consoleTokenFromLocalStorage && refreshTokenFromLocalStorage) {
|
||||
getNewAccessToken(consoleTokenFromLocalStorage, refreshTokenFromLocalStorage).catch(() => {
|
||||
router.replace('/signin')
|
||||
})
|
||||
}
|
||||
|
||||
if (consoleToken && refreshToken) {
|
||||
localStorage.setItem('console_token', consoleToken)
|
||||
localStorage.setItem('refresh_token', refreshToken)
|
||||
getNewAccessToken(consoleToken, refreshToken)
|
||||
getNewAccessToken(consoleToken, refreshToken).catch(() => {
|
||||
router.replace('/signin')
|
||||
})
|
||||
}
|
||||
|
||||
router.replace('/apps', { forceOptimisticNavigation: false } as any)
|
||||
|
|
Loading…
Reference in New Issue
Block a user