Split "auth" and "user" routes
This commit is contained in:
parent
f3939c5016
commit
59b565ae19
15 changed files with 148 additions and 99 deletions
26
internal/dis/component/auth/panel/user.go
Normal file
26
internal/dis/component/auth/panel/user.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package panel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/auth"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/control/static"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/httpx"
|
||||
)
|
||||
|
||||
//go:embed "templates/user.html"
|
||||
var userHTMLStr string
|
||||
var userTemplate = static.AssetsUser.MustParseShared(
|
||||
"user.html",
|
||||
userHTMLStr,
|
||||
)
|
||||
|
||||
func (panel *UserPanel) routeUser(ctx context.Context) http.Handler {
|
||||
return &httpx.HTMLHandler[*auth.AuthUser]{
|
||||
Handler: panel.Dependencies.Auth.UserOf,
|
||||
Template: userTemplate,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue