shad-go/middleware/auth/auth.go

29 lines
464 B
Go
Raw Permalink Normal View History

2023-03-24 23:08:06 +00:00
//go:build !solution
package auth
import (
"context"
"errors"
"net/http"
)
type User struct {
Name string
Email string
}
func ContextUser(ctx context.Context) (*User, bool) {
panic("not implemented")
}
var ErrInvalidToken = errors.New("invalid token")
type TokenChecker interface {
CheckToken(ctx context.Context, token string) (*User, error)
}
func CheckAuth(checker TokenChecker) func(next http.Handler) http.Handler {
panic("not implemented")
}