feat: update some errorhandling #161

This commit is contained in:
2024-09-10 12:13:10 +02:00
parent 37c3b2a780
commit 80ab17276e
7 changed files with 99 additions and 45 deletions

View File

@@ -22,7 +22,7 @@ func EnsureValidSession(db *sql.DB, next http.Handler) http.Handler {
// }
user := utils.GetUserFromSession(db, r)
if user == nil || !user.SessionValid {
if user == nil {
utils.DoRedirect(w, r, "/auth/signin")
return
}
@@ -45,7 +45,7 @@ func EnsureValidSession(db *sql.DB, next http.Handler) http.Handler {
//
// sessionId := getSessionID(r)
// user := verifySession(db, sessionId)
// if user == nil || !user.SessionValid {
// if user == nil {
// return true, false
// }
//