updated context

This commit is contained in:
lnn0q 2025-03-23 21:27:14 +02:00
parent 04b606b7fa
commit 40c35bda13
7 changed files with 67 additions and 25 deletions

View file

@ -1,9 +1,14 @@
import { IdentityContext } from '@app/server/identity';
import { prisma } from '@app/server/prisma/client';
import { MutationLoginArgs, Session } from '@generated/types';
import bcrypt from 'bcrypt';
import jwt from 'jsonwebtoken';
export async function LoginResolver(_: any, { input }: MutationLoginArgs): Promise<Session> {
export async function LoginResolver(
_: any,
{ input }: MutationLoginArgs,
{ identity }: IdentityContext
): Promise<Session> {
const error = 'Invalid username or password';
const user = await prisma.user.findUnique({