Add 2fa routest and business logic

This commit is contained in:
Johannes Zellner
2018-04-25 19:08:15 +02:00
parent d1ed2aa2ce
commit 6574b22cf6
3 changed files with 101 additions and 2 deletions
+4
View File
@@ -130,6 +130,10 @@ function initializeExpressSync() {
router.get ('/api/v1/profile', profileScope, routes.profile.get);
router.post('/api/v1/profile', profileScope, routes.profile.update);
router.post('/api/v1/profile/password', profileScope, routes.user.verifyPassword, routes.profile.changePassword);
router.post('/api/v1/profile/twofactorauthentication', profileScope, routes.profile.setTwoFactorAuthenticationSecret);
router.post('/api/v1/profile/twofactorauthentication/enable', profileScope, routes.profile.enableTwoFactorAuthentication);
router.post('/api/v1/profile/twofactorauthentication/disable', profileScope, routes.user.verifyPassword, routes.profile.disableTwoFactorAuthentication);
// user routes
router.get ('/api/v1/users', usersScope, routes.user.requireAdmin, routes.user.list);