updated context
This commit is contained in:
parent
04b606b7fa
commit
40c35bda13
7 changed files with 67 additions and 25 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue