mirror of
https://github.com/1f349/daisy.git
synced 2025-02-23 14:05:03 +00:00
24 lines
404 B
Go
24 lines
404 B
Go
//go:build nullauth
|
|
|
|
package daisy
|
|
|
|
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
|
|
}
|