router and auth kk
This commit is contained in:
@@ -2,6 +2,7 @@ package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"local/dndex/storage"
|
||||
"local/dndex/storage/entity"
|
||||
"net/http"
|
||||
@@ -27,6 +28,9 @@ func Generate(g storage.RateLimitedGraph, r *http.Request, salt string) (string,
|
||||
|
||||
func generateToken(g storage.RateLimitedGraph, r *http.Request) (Token, string, error) {
|
||||
namespaceRequested := readRequestedNamespace(r)
|
||||
if namespaceRequested == "" {
|
||||
return Token{}, "", errors.New("no namespace found")
|
||||
}
|
||||
key, err := getKeyForNamespace(r.Context(), g, namespaceRequested)
|
||||
if err != nil {
|
||||
return Token{}, "", err
|
||||
|
||||
Reference in New Issue
Block a user