Fix missing MANAGE APPS permission when using client provided in context (#663)

* Fix using wrong token for creating gql client

* Update gorgeous-hats-learn.md
This commit is contained in:
Krzysztof Wolski 2023-06-20 17:21:31 +02:00 committed by GitHub
parent e239fbb670
commit 59ff617282
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View file

@ -0,0 +1,8 @@
---
"saleor-app-emails-and-messages": patch
"saleor-app-invoices": patch
"saleor-app-crm": patch
---
Fixed "Not enough permissions" error during configuration management.

View file

@ -109,7 +109,7 @@ export const protectedClientProcedure = procedure
.use(async ({ ctx, next }) => { .use(async ({ ctx, next }) => {
const client = createGraphQLClient({ const client = createGraphQLClient({
saleorApiUrl: ctx.saleorApiUrl, saleorApiUrl: ctx.saleorApiUrl,
token: ctx.token, token: ctx.appToken,
}); });
return next({ return next({

View file

@ -104,7 +104,7 @@ export const protectedClientProcedure = procedure
.use(attachAppToken) .use(attachAppToken)
.use(validateClientToken) .use(validateClientToken)
.use(async ({ ctx, next }) => { .use(async ({ ctx, next }) => {
const client = createGraphQLClient({ saleorApiUrl: ctx.saleorApiUrl, token: ctx.token }); const client = createGraphQLClient({ saleorApiUrl: ctx.saleorApiUrl, token: ctx.appToken });
return next({ return next({
ctx: { ctx: {

View file

@ -104,7 +104,7 @@ export const protectedClientProcedure = procedure
.use(async ({ ctx, next }) => { .use(async ({ ctx, next }) => {
const client = createGraphQLClient({ const client = createGraphQLClient({
saleorApiUrl: ctx.saleorApiUrl, saleorApiUrl: ctx.saleorApiUrl,
token: ctx.token, token: ctx.appToken,
}); });
return next({ return next({