Merged in fix/book-516 (pull request #3093)
feat(BOOK-516): check valid token * feat(BOOK-516): check valid token Approved-by: Joakim Jäderberg
This commit is contained in:
committed by
Joakim Jäderberg
parent
f502621576
commit
0a5d3ef7c3
@@ -11,6 +11,7 @@ import {
|
||||
appServerClient,
|
||||
configureServerClient,
|
||||
} from "@scandic-hotels/trpc/serverClient"
|
||||
import { isValidSession } from "@scandic-hotels/trpc/utils/session"
|
||||
|
||||
import { webviews } from "@/constants/routes/webviews"
|
||||
|
||||
@@ -50,6 +51,9 @@ export async function createAppContext() {
|
||||
auth: async () => await getUserSession(),
|
||||
getScandicUserToken: async () => {
|
||||
const session = await getUserSession()
|
||||
if (!isValidSession(session)) {
|
||||
return null
|
||||
}
|
||||
return session?.token?.access_token ?? null
|
||||
},
|
||||
getUserPointsBalance: async () => {
|
||||
|
||||
Reference in New Issue
Block a user