16 lines
267 B
Go
16 lines
267 B
Go
|
package auth
|
||
|
|
||
|
import (
|
||
|
"SimpleTutorialHosting/internal/models"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
type contextKey string
|
||
|
|
||
|
const UserContextKey contextKey = "user"
|
||
|
|
||
|
type Authenticator interface {
|
||
|
Authenticate(http.Handler) http.Handler
|
||
|
GetUser(r *http.Request) (*models.User, error)
|
||
|
}
|