mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 18:45:36 +01:00
Added login debugging.
This commit is contained in:
parent
92ab391ef8
commit
1e9a4ad08f
1 changed files with 5 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import debug from 'debug';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import {
|
import {
|
||||||
ok,
|
ok,
|
||||||
|
|
@ -13,6 +14,8 @@ import { secret } from 'lib/crypto';
|
||||||
import { NextApiRequestQueryBody, User } from 'lib/types';
|
import { NextApiRequestQueryBody, User } from 'lib/types';
|
||||||
import { setAuthKey } from 'lib/auth';
|
import { setAuthKey } from 'lib/auth';
|
||||||
|
|
||||||
|
const log = debug('umami:auth');
|
||||||
|
|
||||||
export interface LoginRequestBody {
|
export interface LoginRequestBody {
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
|
@ -51,6 +54,8 @@ export default async (
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log('Login failed:', { user, username, password });
|
||||||
|
|
||||||
return unauthorized(res, 'message.incorrect-username-password');
|
return unauthorized(res, 'message.incorrect-username-password');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue