Refactoring cont.
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
securityHelpers "license-server/helpers/security"
|
||||
httpHelpers "synlotto-website/helpers/http"
|
||||
securityHelpers "synlotto-website/helpers/security"
|
||||
templateHelpers "synlotto-website/helpers/template"
|
||||
"synlotto-website/models"
|
||||
"synlotto-website/storage"
|
||||
@@ -70,11 +70,11 @@ func Login(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if user == nil || !securityHelpers.CheckPasswordHash(user.PasswordHash, password) {
|
||||
storage.LogLoginAttempt(username, false)
|
||||
storage.LogLoginAttempt(r, username, false)
|
||||
http.Error(w, "Invalid credentials", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
storage.LogLoginAttempt(username, true)
|
||||
storage.LogLoginAttempt(r, username, true)
|
||||
|
||||
http.Redirect(w, r, "/", http.StatusSeeOther)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user