2018-05-30 16:52:57 +02:00
|
|
|
package passwordresetroute
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"bitbucket.org/nemt/nemt-portal-api/application/applicationservice"
|
|
|
|
|
"bitbucket.org/nemt/nemt-portal-api/infra/config"
|
|
|
|
|
"github.com/labstack/echo"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
resetRequest = "/request/:email"
|
2018-06-01 05:02:56 +02:00
|
|
|
resetComplete = "/complete/:token"
|
2018-05-31 16:26:40 +02:00
|
|
|
tokenOpen = "/open/:token"
|
2018-05-30 16:52:57 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func Register(r *echo.Group, cfg *config.Config, svc *applicationservice.Service) {
|
|
|
|
|
ctrl := controllerInstance(svc, cfg)
|
|
|
|
|
|
|
|
|
|
r.POST(resetRequest, ctrl.handleResetRequest)
|
|
|
|
|
r.POST(resetComplete, ctrl.handleResetComplete)
|
2018-05-31 16:26:40 +02:00
|
|
|
r.POST(tokenOpen, ctrl.handleTokenOpen)
|
2018-05-30 16:52:57 +02:00
|
|
|
}
|