auth: Improve login parts
This commit is contained in:
parent
1af9d0d83f
commit
515142c055
13 changed files with 382 additions and 101 deletions
24
internal/dis/component/auth/home.go
Normal file
24
internal/dis/component/auth/home.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
_ "embed"
|
||||
"net/http"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/control/static"
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/httpx"
|
||||
)
|
||||
|
||||
//go:embed "templates/home.html"
|
||||
var homeHTMLStr string
|
||||
var homeTemplate = static.AssetsAuthHome.MustParseShared(
|
||||
"home.html",
|
||||
homeHTMLStr,
|
||||
)
|
||||
|
||||
func (auth *Auth) authHome(ctx context.Context) http.Handler {
|
||||
return auth.Protect(&httpx.HTMLHandler[*AuthUser]{
|
||||
Handler: auth.UserOf,
|
||||
Template: homeTemplate,
|
||||
}, nil)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue