Added UI flow for creating default admin account. Dialog will show up after enabling or in the login menu if the admin account isn't present

This commit is contained in:
Tzahi12345
2020-04-30 16:31:36 -04:00
parent e5f9694da0
commit e7b841c056
11 changed files with 163 additions and 2 deletions

View File

@@ -2735,6 +2735,16 @@ app.post('/api/auth/jwtAuth'
, auth_api.generateJWT
, auth_api.returnAuthResponse
);
app.post('/api/auth/changePassword', optionalJwt, async (req, res) => {
let user_uid = req.user.uid;
let password = req.body.password;
let success = await auth_api.changeUserPassword(user_uid, password);
res.send({success: success});
});
app.post('/api/auth/adminExists', async (req, res) => {
let exists = auth_api.adminExists();
res.send({exists: exists});
});
app.use(function(req, res, next) {
//if the request is not html then move along