chore(auth): #331 add and fix forgot password tests
This commit is contained in:
@@ -48,9 +48,9 @@ func (handler AuthImpl) Handle(router *http.ServeMux) {
|
||||
router.Handle("GET /auth/change-password", handler.handleChangePasswordPage())
|
||||
router.Handle("POST /api/auth/change-password", handler.handleChangePasswordComp())
|
||||
|
||||
router.Handle("/auth/forgot-password", handler.handleForgotPasswordPage())
|
||||
router.Handle("/api/auth/forgot-password", handler.handleForgotPasswordComp())
|
||||
router.Handle("/api/auth/forgot-password-actual", handler.handleForgotPasswordResponseComp())
|
||||
router.Handle("GET /auth/forgot-password", handler.handleForgotPasswordPage())
|
||||
router.Handle("POST /api/auth/forgot-password", handler.handleForgotPasswordComp())
|
||||
router.Handle("POST /api/auth/forgot-password-actual", handler.handleForgotPasswordResponseComp())
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -355,14 +355,13 @@ func (handler AuthImpl) handleForgotPasswordComp() http.HandlerFunc {
|
||||
if err != nil {
|
||||
utils.TriggerToast(w, r, "error", "Internal Server Error", http.StatusInternalServerError)
|
||||
} else {
|
||||
utils.TriggerToast(w, r, "info", "If the email exists, an email has been sent", http.StatusOK)
|
||||
utils.TriggerToast(w, r, "info", "If the address exists, an email has been sent.", http.StatusOK)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (handler AuthImpl) handleForgotPasswordResponseComp() http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
pageUrl, err := url.Parse(r.Header.Get("HX-Current-URL"))
|
||||
if err != nil {
|
||||
log.Error("Could not get current URL: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user