mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 12:01:52 -07:00
Merge 77b3efe379 into 0ec7b458cc
This commit is contained in:
commit
30f6a86c1d
1 changed files with 4 additions and 0 deletions
|
|
@ -133,6 +133,10 @@ func validateAPIKey(ctx context.Context, store db.DB, r *http.Request) (*models.
|
|||
l.Debug().Msg("ValidateApiKey: Checking if user is already authenticated")
|
||||
|
||||
authH := r.Header.Get("Authorization")
|
||||
if authH == "" {
|
||||
return nil, nil // no header present, not an error
|
||||
}
|
||||
|
||||
var token string
|
||||
if strings.HasPrefix(strings.ToLower(authH), "token ") {
|
||||
token = strings.TrimSpace(authH[6:]) // strip "Token "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue