aboutsummaryrefslogtreecommitdiff
path: root/http_handle_login.go
diff options
context:
space:
mode:
Diffstat (limited to 'http_handle_login.go')
-rw-r--r--http_handle_login.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/http_handle_login.go b/http_handle_login.go
index 70a8c8b..2d2dbf6 100644
--- a/http_handle_login.go
+++ b/http_handle_login.go
@@ -16,7 +16,7 @@ func handle_login(w http.ResponseWriter, r *http.Request, params map[string]any)
if r.Method != "POST" {
err := templates.ExecuteTemplate(w, "login", params)
if err != nil {
- http.Error(w, "Error rendering template:: "+err.Error(), http.StatusInternalServerError)
+ http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError)
}
return
}
@@ -32,17 +32,17 @@ func handle_login(w http.ResponseWriter, r *http.Request, params map[string]any)
params["login_error"] = "Unknown username"
err := templates.ExecuteTemplate(w, "login", params)
if err != nil {
- http.Error(w, "Error rendering template:: "+err.Error(), http.StatusInternalServerError)
+ http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError)
}
return
}
- http.Error(w, "Error querying user information:: "+err.Error(), http.StatusInternalServerError)
+ http.Error(w, "Error querying user information: "+err.Error(), http.StatusInternalServerError)
return
}
match, err := argon2id.ComparePasswordAndHash(password, password_hash)
if err != nil {
- http.Error(w, "Error comparing password and hash:: "+err.Error(), http.StatusInternalServerError)
+ http.Error(w, "Error comparing password and hash: "+err.Error(), http.StatusInternalServerError)
return
}
@@ -50,7 +50,7 @@ func handle_login(w http.ResponseWriter, r *http.Request, params map[string]any)
params["login_error"] = "Invalid password"
err := templates.ExecuteTemplate(w, "login", params)
if err != nil {
- http.Error(w, "Error rendering template:: "+err.Error(), http.StatusInternalServerError)
+ http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError)
return
}
return
@@ -75,7 +75,7 @@ func handle_login(w http.ResponseWriter, r *http.Request, params map[string]any)
_, err = database.Exec(r.Context(), "INSERT INTO sessions (user_id, session_id) VALUES ($1, $2)", user_id, cookie_value)
if err != nil {
- http.Error(w, "Error inserting session:: "+err.Error(), http.StatusInternalServerError)
+ http.Error(w, "Error inserting session: "+err.Error(), http.StatusInternalServerError)
return
}