Skip to content

Commit

Permalink
Redirect signups with unverified emails to UI error page (#2467)
Browse files Browse the repository at this point in the history
  • Loading branch information
begelundmuller authored May 22, 2023
1 parent 921d906 commit 0f03606
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion admin/server/auth/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ func (a *Authenticator) authLoginCallback(w http.ResponseWriter, r *http.Request

// Check that the user's email is verified
if !emailVerified {
http.Error(w, "email not verified", http.StatusUnauthorized)
errorRedirect, err := url.JoinPath(a.opts.FrontendURL, "/-/auth/verify-email")
if err != nil {
internalServerError(w, fmt.Errorf("failed to email verify uri: %w", err))
return
}

http.Redirect(w, r, errorRedirect, http.StatusTemporaryRedirect)
return
}

Expand Down

0 comments on commit 0f03606

Please sign in to comment.