Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make forgot password response obscure #2144

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions api/handlers/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,8 @@ func (h *Handler) ForgotPassword(w http.ResponseWriter, r *http.Request) {
Data: &forgotPassword,
}

err = gp.Run(r.Context())
if err != nil {
_ = render.Render(w, r, util.NewServiceErrResponse(err))
return
}
_ = render.Render(w, r, util.NewServerResponse("Password reset token has been sent successfully", nil, http.StatusOK))
_ = gp.Run(r.Context())
_ = render.Render(w, r, util.NewServerResponse("if your email is registered on the platform, please check the email we have sent you to verify your account", nil, http.StatusOK))
}

func (h *Handler) VerifyEmail(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -253,7 +249,7 @@ func (h *Handler) ResetPassword(w http.ResponseWriter, r *http.Request) {

user, err := rs.Run(r.Context())
if err != nil {
_ = render.Render(w, r, util.NewServiceErrResponse(err))
_ = render.Render(w, r, util.NewErrorResponse("failed to reset password", http.StatusBadRequest))
return
}

Expand Down
2 changes: 1 addition & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package docs Code generated by swaggo/swag at 2024-09-02 15:03:52.730374 +0100 BST m=+2.026310793. DO NOT EDIT
// Package docs Code generated by swaggo/swag at 2024-09-11 16:05:36.279541 +0100 BST m=+2.178903459. DO NOT EDIT
package docs

import "github.com/swaggo/swag"
Expand Down
Loading