mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
1be43911b4
Set Prettier's "trailingComma" setting to "es5" GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
48 lines
1.3 KiB
JavaScript
48 lines
1.3 KiB
JavaScript
const PasswordResetController = require('./PasswordResetController')
|
|
const AuthenticationController = require('../Authentication/AuthenticationController')
|
|
const { Joi, validate } = require('../../infrastructure/Validation')
|
|
|
|
module.exports = {
|
|
apply(webRouter, apiRouter) {
|
|
webRouter.get(
|
|
'/user/password/reset',
|
|
PasswordResetController.renderRequestResetForm
|
|
)
|
|
webRouter.post(
|
|
'/user/password/reset',
|
|
validate({
|
|
body: Joi.object({
|
|
email: Joi.string().required(),
|
|
}),
|
|
}),
|
|
PasswordResetController.requestReset
|
|
)
|
|
AuthenticationController.addEndpointToLoginWhitelist('/user/password/reset')
|
|
|
|
webRouter.get(
|
|
'/user/password/set',
|
|
PasswordResetController.renderSetPasswordForm
|
|
)
|
|
webRouter.post(
|
|
'/user/password/set',
|
|
validate({
|
|
body: Joi.object({
|
|
password: Joi.string().required(),
|
|
passwordResetToken: Joi.string().required(),
|
|
}),
|
|
}),
|
|
PasswordResetController.setNewUserPassword
|
|
)
|
|
AuthenticationController.addEndpointToLoginWhitelist('/user/password/set')
|
|
|
|
webRouter.post(
|
|
'/user/reconfirm',
|
|
validate({
|
|
body: Joi.object({
|
|
email: Joi.string().required(),
|
|
}),
|
|
}),
|
|
PasswordResetController.requestReset
|
|
)
|
|
},
|
|
}
|