1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

fix(api): no admin user creat

This commit is contained in:
diced 2021-08-07 20:38:15 -07:00
parent 6733c9adba
commit 2c605cb176
No known key found for this signature in database
GPG key ID: 85AB64C74535D76E

View file

@ -10,7 +10,7 @@ async function handler(req: NextApiReq, res: NextApiRes) {
if (req.method !== 'POST') return res.status(405).end();
const { username, password } = req.body as { username: string, password: string };
const { username, password, administrator } = req.body as { username: string, password: string, administrator: boolean };
if (!username) return res.bad('no username');
if (!password) return res.bad('no auth');
@ -28,7 +28,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
data: {
password: hashed,
username,
token: createToken()
token: createToken(),
administrator
}
});