New assets, fixed list box scrolling, header text, etc..

This commit is contained in:
John Lyon-Smith
2018-03-05 15:18:08 -08:00
parent eaf26343b8
commit 535fffaf41
33 changed files with 354 additions and 231 deletions

View File

@@ -90,13 +90,13 @@ export class AuthRoutes {
res.set('Authorization', `Bearer ${savedUser.loginToken}`)
res.json(savedUser.toClient())
} else {
return Promise.reject(createError.BadRequest('Email or password incorrect'))
return Promise.reject(createError.BadRequest('email or password incorrect'))
}
}).catch((err) => {
if (err instanceof createError.HttpError) {
next(err)
} else {
next(createError.InternalServerError(`Unable to login. ${err ? err.message : ''}`))
next(createError.InternalServerError(`${err ? err.message : ''}`))
}
})
}
@@ -126,11 +126,10 @@ export class AuthRoutes {
let existingEmail = req.body.existingEmail
const newEmail = req.body.newEmail
let User = this.db.User
const role = req.user.role
const isAdminOrExec = (role === 'executive' || role === 'administrator')
const isAdmin = !!req.user.administrator
if (existingEmail) {
if (!isAdminOrExec) {
if (!isAdmin) {
return next(createError.Forbidden('Only admins can resend change email to any user'))
}
} else {