fix: removed console.log in different authentication methods
This commit is contained in:
parent
ff6133d80b
commit
70877ea8dc
|
@ -11,7 +11,6 @@ export function LoginForm() {
|
||||||
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
console.log('Trying to sign in');
|
|
||||||
await signIn('credentials', {
|
await signIn('credentials', {
|
||||||
key: password,
|
key: password,
|
||||||
callbackUrl: '/play',
|
callbackUrl: '/play',
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { getServerSession, RequestInternal, type NextAuthOptions, User } from "n
|
||||||
import type { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from "next"
|
import type { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from "next"
|
||||||
|
|
||||||
export async function authenticate(key: string) {
|
export async function authenticate(key: string) {
|
||||||
console.log("Running authenticate function with key: " + key);
|
|
||||||
const user = await prisma.users.findUnique({
|
const user = await prisma.users.findUnique({
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
@ -17,8 +16,6 @@ export async function authenticate(key: string) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Found user: " + JSON.stringify(user));
|
|
||||||
|
|
||||||
if(!user) return null;
|
if(!user) return null;
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
|
@ -61,12 +58,9 @@ export const authOptions: NextAuthOptions = {
|
||||||
const { key } = credentials as {
|
const { key } = credentials as {
|
||||||
key: string
|
key: string
|
||||||
};
|
};
|
||||||
console.log("Running authorize function with key: " + key)
|
|
||||||
|
|
||||||
const user = await authenticate(key) as User | null
|
const user = await authenticate(key) as User | null
|
||||||
|
|
||||||
console.log("Found user in authorize: " + JSON.stringify(user));
|
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue