mirror of
https://github.com/1f349/jasmine.git
synced 2025-02-22 13:35:05 +00:00
24 lines
406 B
Go
24 lines
406 B
Go
//go:build nullauth
|
|
|
|
package jasmine
|
|
|
|
import (
|
|
"context"
|
|
"github.com/charmbracelet/log"
|
|
"net/http"
|
|
)
|
|
|
|
func NewAuth(db string, logger *log.Logger) AuthProvider {
|
|
return &nullAuth{}
|
|
}
|
|
|
|
type nullAuth struct{}
|
|
|
|
func (n *nullAuth) Middleware(next http.Handler) http.Handler {
|
|
return next
|
|
}
|
|
|
|
func (n *nullAuth) CurrentUserPrincipal(ctx context.Context) (string, error) {
|
|
return "/jane@example.com/", nil
|
|
}
|