Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennard Schwarz committed Sep 12, 2024
1 parent fd922df commit 20dce06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ func (s *Server) AuthHandler(providerName, rule string) http.HandlerFunc {
if !valid {
logger.WithField("email", email).Warn("Invalid email")

if config.LogoutIfInvalidEmail == true {
if config.LogoutIfInvalidEmail {
// The email address isn't valid so display an error and clear the cookie
// Clearing the cookie will allow the user to try another email address and avoid being trapped on 'Not authorized'
http.SetCookie(w, ClearCookie(r))
http.Error(w, "Not authorized (Refresh to try again with a different email address)", 401)
}else {
} else {
http.Error(w, "Not authorized", 401)
}
return
Expand Down

0 comments on commit 20dce06

Please sign in to comment.