fix: auth server utils upgrade to latest nuxt-graphql
This commit is contained in:
@@ -2,15 +2,15 @@ import type { H3Event } from "h3";
|
||||
import { GraphQLClient } from "graphql-request";
|
||||
import { jwtDecode } from "jwt-decode";
|
||||
import type { User } from "#auth-utils";
|
||||
import type { AuthUserFragment } from "#graphql/fragments";
|
||||
import { AuthRefreshTokenDocument, type AuthLoginResult } from "#graphql/operations";
|
||||
import type { AuthUserFragment, AuthLoginMutationResult } from "#graphql/operations";
|
||||
import { AuthRefreshTokenDocument } from "#graphql/operations";
|
||||
|
||||
// Handle login result and store user session
|
||||
export async function handleLogin(event: H3Event, loginData: AuthLoginResult) {
|
||||
if (!loginData?.login) {
|
||||
export async function handleLogin(event: H3Event, loginResult: AuthLoginMutationResult) {
|
||||
if (!loginResult?.login) {
|
||||
return false;
|
||||
}
|
||||
const { user, authToken, refreshToken } = loginData.login;
|
||||
const { user, authToken, refreshToken } = loginResult.login;
|
||||
if (!user || !authToken || !refreshToken) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user