Login form will force username if there is an authenticated user

This commit is contained in:
garrettmills
2020-05-22 09:54:48 -05:00
parent decb83bdbb
commit 4f8c4d641f
5 changed files with 29 additions and 2 deletions

View File

@@ -7,6 +7,17 @@ class AuthController extends Controller {
return [...super.services, 'models', 'auth', 'MFA', 'output', 'configs', 'utility']
}
async get_auth_user(req, res, next) {
if ( req.user ) {
return res.api({
authenticated: true,
uid: req.user.uid,
})
}
return res.api({ authenticated: false })
}
async get_traps(req, res, next) {
const trap_config = this.configs.get('traps')
const data = [{ name: '(None)', trap: '', redirect_to: '/' }]