Added test capability and tests for authentication middleware

This commit is contained in:
2025-02-12 21:23:13 +11:00
parent ca92d573ba
commit 2d52084fa7
12 changed files with 334 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ func CheckTokenNotRevoked(conn *sql.DB, t Token) (bool, error) {
jti := t.GetJTI()
query := `SELECT 1 FROM jwtblacklist WHERE jti = ? LIMIT 1`
rows, err := conn.Query(query, jti)
defer rows.Close()
if err != nil {
return false, errors.Wrap(err, "conn.Exec")
}