Skip to content

Commit

Permalink
Merge pull request #100 from vtex-apps/fix/check-userpermission
Browse files Browse the repository at this point in the history
fix: Fixed VtexIdclientAutCookie when send the headers properly
  • Loading branch information
arturmagalhaesjr authored Mar 20, 2023
2 parents a5b8551 + aae7acb commit ce16d8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Fixed VtexIdclientAutCookie when send the headers properly


## [0.30.2] - 2023-03-17

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions node/resolvers/directives/checkAdminAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export class CheckAdminAccess extends SchemaDirectiveVisitor {
token = (
await identity.getToken({ appkey: appKey, apptoken: apiToken })
).token
context.cookies.set('VtexIdclientAutCookie', token)
context.vtex.adminUserAuthToken = token
}

if (!token) {
Expand Down
2 changes: 2 additions & 0 deletions node/resolvers/directives/checkUserAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export class CheckUserAccess extends SchemaDirectiveVisitor {
token = (
await identity.getToken({ appkey: appKey, apptoken: apiToken })
).token
context.cookies.set('VtexIdclientAutCookie', token)
context.vtex.adminUserAuthToken = token
}

if (!token && !storeUserAuthToken) {
Expand Down

0 comments on commit ce16d8c

Please sign in to comment.