mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Check for DISABLE_LOGIN on api route.
This commit is contained in:
parent
253a46460b
commit
7b9c29e039
1 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import {
|
|||
checkPassword,
|
||||
createSecureToken,
|
||||
methodNotAllowed,
|
||||
forbidden,
|
||||
} from 'next-basics';
|
||||
import redis from '@umami/redis-client';
|
||||
import { getUserByUsername } from 'queries';
|
||||
|
|
@ -30,6 +31,10 @@ export default async (
|
|||
req: NextApiRequestQueryBody<any, LoginRequestBody>,
|
||||
res: NextApiResponse<LoginResponse>,
|
||||
) => {
|
||||
if (process.env.DISABLE_LOGIN) {
|
||||
return forbidden(res);
|
||||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
const { username, password } = req.body;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue