Skip to content

Commit

Permalink
Fix invalid query result destructuring in passport auth(#3218) (#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Amorim authored Jul 1, 2020
1 parent 2806a0b commit 5a75711
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/hungry-tables-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystonejs/auth-passport': patch
---

Fix invalid query result destructuring.
These changes correct the regression introduced by the latest version (`5.2.2`).
4 changes: 2 additions & 2 deletions packages/auth-passport/lib/Passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class PassportAuthStrategy {

// Here we create both the Passport Session Item and the User Item
// in KS5 as a single, nested mutation.
const { sessionItem } = await this._executeQuery({
const data = await this._executeQuery({
query: `
mutation($id: ID!, $data: ${passportSessionMutationInputName}) {
session: ${passportSessionMutationName}(id: $id , data: $data) {
Expand All @@ -491,7 +491,7 @@ class PassportAuthStrategy {
variables: { id: passportSessionInfo.id, data: { item: { [operation]: itemData } } },
});

return sessionItem.session.item;
return data.session.item;
}

async _authenticateItem(item, accessToken, isNewItem, req, res, next) {
Expand Down

0 comments on commit 5a75711

Please sign in to comment.