Login fully working (via HTMX and Cookies)

Moved code bits around for more Exported functions
Fixed JWT validation
This commit is contained in:
Caleb Gardner
2024-11-11 13:25:38 -06:00
parent e183eefee8
commit 8eb031c64f
4 changed files with 21 additions and 18 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ func (b *Backend) ParseHeader(r *http.Request) (*ParsedHeader, error) {
if apiKey.Death > 0 && time.Unix(apiKey.Death, 0).Before(time.Now()) {
return nil, ErrApiKeyUnauthorized
}
out.Key = apiKey
out.Key = &apiKey
} else {
fmt.Println("origin:", r.Header.Get("origin"))
keys, err := b.keyTable.Find(r.Context(), map[string]any{"allowedOrigins": r.Header.Get("origin")})