overleaf/services/web/app/coffee/Features/PasswordReset/PasswordResetRouter.coffee
Henry Oswald 1cc0cbe8fc split site into 2 routers, webRouter and apiRouter
web router has things like sessions etc added onto it. Api router is minimal, doesn't include things like csrf
2015-07-01 15:23:18 +01:00

14 lines
688 B
CoffeeScript

PasswordResetController = require("./PasswordResetController")
AuthenticationController = require('../Authentication/AuthenticationController')
module.exports =
apply: (webRouter, apiRouter) ->
webRouter.get '/user/password/reset', PasswordResetController.renderRequestResetForm
webRouter.post '/user/password/reset', PasswordResetController.requestReset
AuthenticationController.addEndpointToLoginWhitelist '/user/password/reset'
webRouter.get '/user/password/set', PasswordResetController.renderSetPasswordForm
webRouter.post '/user/password/set', PasswordResetController.setNewUserPassword
AuthenticationController.addEndpointToLoginWhitelist '/user/password/set'