Merged in fix/sw-3627-pass-user-access-token-payment-callback (pull request #3189)

fix(SW-3627): Pass social session user token to payment callback apge

* Pass social session user token to payment callback apge


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-11-20 12:36:40 +00:00
parent bd85dd3b49
commit 36cd1a5cdf
2 changed files with 31 additions and 11 deletions

View File

@@ -3,6 +3,8 @@ import { logger } from "@scandic-hotels/common/logger"
import { bookingFlowConfig } from "@/constants/bookingFlowConfig"
import { getSocialSession, isValidSocialSession } from "@/auth/scandic/session"
import type { PaymentCallbackStatusEnum } from "@scandic-hotels/common/constants/paymentCallbackStatusEnum"
import type { LangParams, PageArgs } from "@/types/params"
@@ -15,12 +17,11 @@ export default async function PaymentCallbackPage(
logger.debug(`[payment-callback] callback started`)
const lang = params.lang
const userAccessToken = null
// TODO fix when auth is implemented
// const session = await auth()
// if (isValidSession(session)) {
// userAccessToken = session.token.access_token
// }
let userAccessToken = null
const session = await getSocialSession()
if (isValidSocialSession(session)) {
userAccessToken = session.access_token
}
return (
<PaymentCallbackPagePrimitive