Show error when credentials are invalid
This commit is contained in:
parent
50a0844ebb
commit
3e76c41a9c
1 changed files with 5 additions and 1 deletions
|
|
@ -274,7 +274,11 @@ func postSignin(w http.ResponseWriter, r *http.Request) {
|
|||
_, err := auth.SigninUser(r, username, password)
|
||||
if err != nil {
|
||||
if errors.Is(err, auth.InvalidCredentials{}) {
|
||||
http.Redirect(w, r, "/?error=invalid-credentials", http.StatusFound)
|
||||
http.Redirect(w, r, "/signin?error=invalid-credentials", http.StatusFound)
|
||||
return
|
||||
}
|
||||
if errors.Is(err, auth.InvalidUsername{}) {
|
||||
http.Redirect(w, r, "/signin?error=invalid-credentials", http.StatusFound)
|
||||
return
|
||||
}
|
||||
respondError(w, "Failed to signin user", err, http.StatusInternalServerError)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue