Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit c4307db1b8, reversing
changes made to 5472f952d4.
This commit is contained in:
Shubham Verma 2021-10-10 09:22:18 +05:30
parent 6caff7df0e
commit 37bdf21b21
11 changed files with 486 additions and 538 deletions

View file

@ -2,15 +2,11 @@ import { serialize } from 'cookie';
import { checkPassword, createSecureToken } from 'lib/crypto';
import { getAccountByUsername } from 'lib/queries';
import { AUTH_COOKIE_NAME } from 'lib/constants';
import { ok, unauthorized, badRequest } from 'lib/response';
import { ok, unauthorized } from 'lib/response';
export default async (req, res) => {
const { username, password } = req.body;
if (!username || !password) {
return badRequest(res);
}
const account = await getAccountByUsername(username);
if (account && (await checkPassword(password, account.password))) {