Skip to content

Commit

Permalink
Speed up getUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexite committed Apr 6, 2022
1 parent c10cebd commit 2329e12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/remotes/auth0/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ export default function createAuth0Schema(domain, clientId, clientSecret) {
getUser: async (_, { where, fresh }, ctx) => {
try {
const fn = fresh ? findUsersUncached : findUsers;
await updateUser(where, { scopes: ["write:users"] }, (prev) => {
const user = sanitizeUser({ ...prev })
return { ...user };
});
// await updateUser(where, { scopes: ["write:users"] }, (prev) => {
// const user = sanitizeUser({ ...prev })
// return { ...user };
// });
return (await fn(where, ctx))[0] || null
} catch (ex) { return null; }
},
Expand Down

0 comments on commit 2329e12

Please sign in to comment.