change api

This commit is contained in:
Rafi
2023-02-22 22:23:10 +08:00
parent 3e46512c15
commit 49d634987d
2 changed files with 9 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ const ENDPOINTS = {
export default defineNuxtPlugin(() => {
const token = useCookie(COOKIE_OPTIONS.prefix + '.' + COOKIE_OPTIONS.tokenName, {
maxAge: 60 * 30,
maxAge: 60 * 5,
})
const refreshToken = useCookie(COOKIE_OPTIONS.prefix + '.' + COOKIE_OPTIONS.refreshTokenName, {
maxAge: 60 * 60 * 24,
@@ -80,6 +80,7 @@ export default defineNuxtPlugin(() => {
'refresh': refreshToken.value
}
})
console.log('refresh', data, error)
if (!error.value) {
token.value = data.value.access
}