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:
parent
6733c9adba
commit
2c605cb176
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue