phase 6 เบื้องต้น
This commit is contained in:
parent
1bb850c6b8
commit
93570d38d8
20 changed files with 1715 additions and 34 deletions
8
web/app/plugins/auth.client.ts
Normal file
8
web/app/plugins/auth.client.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* ต่ออายุ session ตอนแอป boot (client เท่านั้น) — ถ้ามี refresh token ใน sessionStorage
|
||||
* ก็ได้ access token กลับมาโดยไม่ต้อง redirect ไป Keycloak ใหม่
|
||||
* เป็น async plugin เพื่อรอผลก่อนหน้าแรก render (กัน UI กระพริบไปหน้า login แป๊บนึง)
|
||||
*/
|
||||
export default defineNuxtPlugin(async () => {
|
||||
await useAuth().restoreSession()
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue