diff --git a/README.md b/README.md index b11e6b8d3..005ed85b1 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ GOOGLE_CLIENT_SECRET= [podman-compose](https://github.com/containers/podman-compose) is used to run a local copy of all required services together. -#### macOS Development Setup +#### macOS Development Setup + If you're working on macOS and encounter issues with file watching in Vite, use the following environment variables (in config.env): ``` diff --git a/packages/openneuro-server/src/graphql/resolvers/user.ts b/packages/openneuro-server/src/graphql/resolvers/user.ts index b0bdb6799..34649e690 100644 --- a/packages/openneuro-server/src/graphql/resolvers/user.ts +++ b/packages/openneuro-server/src/graphql/resolvers/user.ts @@ -3,13 +3,17 @@ */ import User from "../../models/user" -export const user = (obj, { id }) => { +export const user = (obj, { id, key }) => { function isValidOrcid(orcid: string): boolean { return /^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$/.test(orcid || "") } if (isValidOrcid(id)) { - return User.findOne({ "orcid": id }).exec() + if (key === "orcid") { + return User.findOne({ "orcid": id }).exec() + } else { + return User.findOne({ "providerId": id }).exec() + } } else { return User.findOne({ "id": id }).exec() }