Add support to upload custom profile avatar

This commit is contained in:
Johannes Zellner
2019-11-25 16:12:22 +01:00
parent 14d26fe064
commit f2fca33309
5 changed files with 40 additions and 2 deletions

View File

@@ -184,6 +184,9 @@ function initializeExpressSync() {
// working off the user behind the provided token
router.get ('/api/v1/profile', profileScope, routes.profile.get);
router.post('/api/v1/profile', profileScope, routes.profile.update);
router.get ('/api/v1/profile/avatar/:identifier', routes.profile.getAvatar);
router.post('/api/v1/profile/avatar', profileScope, multipart, routes.profile.setAvatar);
router.del ('/api/v1/profile/avatar', profileScope, routes.profile.clearAvatar);
router.post('/api/v1/profile/password', profileScope, routes.users.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);