aboutsummaryrefslogtreecommitdiff
path: root/http_auth.go
diff options
context:
space:
mode:
Diffstat (limited to 'http_auth.go')
-rw-r--r--http_auth.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/http_auth.go b/http_auth.go
index 370e38b..eb6e604 100644
--- a/http_auth.go
+++ b/http_auth.go
@@ -10,7 +10,7 @@ func get_user_info_from_request(r *http.Request) (id int, username string, err e
return
}
- err = database.QueryRow(r.Context(), "SELECT user_id, username FROM users u JOIN sessions s ON u.id = s.user_id WHERE s.session_id = $1;", session_cookie.Value).Scan(&id, &username)
+ err = database.QueryRow(r.Context(), "SELECT user_id, COALESCE(username, '') FROM users u JOIN sessions s ON u.id = s.user_id WHERE s.session_id = $1;", session_cookie.Value).Scan(&id, &username)
return
}