feat: Initial authentication logic and UX
This commit is contained in:
11
wp-content/themes/moonshine/server/graphql/context.ts
Normal file
11
wp-content/themes/moonshine/server/graphql/context.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { defineGraphQLContext } from "@lewebsimple/nuxt-graphql/helpers";
|
||||
import type { AuthLoginMutation } from "#graphql/typed-documents";
|
||||
|
||||
export default defineGraphQLContext(async (event) => {
|
||||
const authToken = await getAuthToken(event);
|
||||
|
||||
return {
|
||||
authToken,
|
||||
handleLogin: async (loginData: AuthLoginMutation) => handleLogin(event, loginData),
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user