2016-05-17 21:50:37 +02:00
|
|
|
import { Router } from 'express';
|
|
|
|
import * as UserController from '../controllers/user.controller';
|
2018-01-09 21:57:49 +01:00
|
|
|
import isAuthenticated from '../utils/isAuthenticated';
|
2017-02-22 20:29:35 +01:00
|
|
|
|
2016-05-17 21:50:37 +02:00
|
|
|
const router = new Router();
|
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.post('/signup', UserController.createUser);
|
2016-06-09 02:52:59 +02:00
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.get('/signup/duplicate_check', UserController.duplicateUserCheck);
|
2016-09-02 20:51:30 +02:00
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.put('/preferences', isAuthenticated, UserController.updatePreferences);
|
2016-08-05 03:43:13 +02:00
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.post('/reset-password', UserController.resetPasswordInitiate);
|
2016-10-12 20:25:24 +02:00
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.get('/reset-password/:token', UserController.validateResetPasswordToken);
|
2016-10-18 22:07:25 +02:00
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.post('/reset-password/:token', UserController.updatePassword);
|
2016-10-18 22:07:25 +02:00
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.put('/account', isAuthenticated, UserController.updateSettings);
|
2017-03-16 23:25:12 +01:00
|
|
|
|
2019-05-13 21:29:00 +02:00
|
|
|
router.post('/account/api-keys', isAuthenticated, UserController.createApiKey);
|
2018-10-14 21:08:36 +02:00
|
|
|
|
|
|
|
router.delete('/account/api-keys/:keyId', isAuthenticated, UserController.removeApiKey);
|
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.post('/verify/send', UserController.emailVerificationInitiate);
|
2017-06-26 18:48:28 +02:00
|
|
|
|
2018-01-09 21:57:49 +01:00
|
|
|
router.get('/verify', UserController.verifyEmail);
|
2017-06-26 18:48:28 +02:00
|
|
|
|
2016-05-17 21:50:37 +02:00
|
|
|
export default router;
|