From 1e9a4ad08fb7910ac7c0c9430cb03571558db8c6 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 24 Apr 2023 21:35:09 -0700 Subject: [PATCH] Added login debugging. --- pages/api/auth/login.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pages/api/auth/login.ts b/pages/api/auth/login.ts index 9bdfec22..7ff6267d 100644 --- a/pages/api/auth/login.ts +++ b/pages/api/auth/login.ts @@ -1,3 +1,4 @@ +import debug from 'debug'; import { NextApiResponse } from 'next'; import { ok, @@ -13,6 +14,8 @@ import { secret } from 'lib/crypto'; import { NextApiRequestQueryBody, User } from 'lib/types'; import { setAuthKey } from 'lib/auth'; +const log = debug('umami:auth'); + export interface LoginRequestBody { username: string; password: string; @@ -51,6 +54,8 @@ export default async ( }); } + log('Login failed:', { user, username, password }); + return unauthorized(res, 'message.incorrect-username-password'); }