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:
@@ -7,14 +7,16 @@ import { safeProtectedServiceProcedure } from "../../../../procedures"
|
||||
import { encrypt } from "../../../../utils/encryption"
|
||||
import { isValidSession } from "../../../../utils/session"
|
||||
import { getMembershipNumber } from "../../../user/utils"
|
||||
import { isPartnerLoggedInUser } from "../../utils"
|
||||
import { createBookingInput, createBookingSchema } from "./schema"
|
||||
|
||||
export const create = safeProtectedServiceProcedure
|
||||
.input(createBookingInput)
|
||||
.use(async ({ ctx, next }) => {
|
||||
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