This commit is contained in:
Yovan
2026-10-03 20:28:25 +07:00
parent 14283c2b61
commit 650b24619f
23 changed files with 2373 additions and 30 deletions
+15
View File
@@ -0,0 +1,15 @@
package middleware
import (
"context"
"5803025020/w04/internal/models"
)
// SessionLookup is the small interface RequireAuth needs to resolve a bearer
// token to the session (and therefore the user id) it belongs to. Defined
// here (the consumer) so internal/store never needs to import middleware.
// *store.SessionStore satisfies this implicitly via its existing Get method.
type SessionLookup interface {
Get(ctx context.Context, token string) (*models.Session, error)
}