I realized it’s because it’s not finding the proper key in the authToken object… I had change your example code to match my namespace (which is the key) like so (also, I’m not using Typescript here):
export const getCurrentUser = async (authToken) => {
const email =
authToken === null || authToken === void 0
? void 0
: authToken['https://api.geocities.dev/email']
if (!email) {
throw new AuthenticationError('Uh oh!')
}
let user = await db.user.findOne({ where: { email } })
if (!user) {
user = await db.user.create({ data: { email } })
}
return user
}