Tuas W06
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user