added token loading from env vars
This commit is contained in:
@ -7,12 +7,11 @@ type UserType = {
|
||||
|
||||
const resolveUserFn = async context => {
|
||||
const authHeader = context.req.headers.authorization;
|
||||
if (authHeader !== "token123") {
|
||||
const authtoken = process.env.GRAPHQL_MESH
|
||||
if (authHeader !== authtoken) {
|
||||
console.error('Failed to validate token')
|
||||
return null
|
||||
}
|
||||
// If the token is valid, return the user
|
||||
// Replace this with your actual user fetching logic
|
||||
return { id: 'user1' };
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user