Merged in fix/SW-3536-wl-cannot-initialize-payment- (pull request #2953)
fix SW-3536 Fixed create booking call for sas logged in users in the partner site Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -21,7 +21,7 @@ import {
|
||||
getBookingStatusInput,
|
||||
getLinkedReservationsInput,
|
||||
} from "./input"
|
||||
import { findBooking, getBooking } from "./utils"
|
||||
import { findBooking, getBooking, isPartnerLoggedInUser } from "./utils"
|
||||
|
||||
const refIdPlugin = createRefIdPlugin()
|
||||
|
||||
@@ -31,9 +31,10 @@ export const bookingQueryRouter = router({
|
||||
.concat(refIdPlugin.toConfirmationNumber)
|
||||
.use(async ({ ctx, input, next }) => {
|
||||
const lang = input.lang ?? ctx.lang
|
||||
const token = isValidSession(ctx.session)
|
||||
? ctx.session.token.access_token
|
||||
: ctx.serviceToken
|
||||
const token =
|
||||
isValidSession(ctx.session) && !isPartnerLoggedInUser(ctx.session)
|
||||
? ctx.session.token.access_token
|
||||
: ctx.serviceToken
|
||||
|
||||
return next({
|
||||
ctx: {
|
||||
|
||||
Reference in New Issue
Block a user