User login & logout
This commit is contained in:
@ -10,7 +10,11 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func Main(contents templ.Component) templ.Component {
|
||||
import (
|
||||
"stevenlr.com/timer/model"
|
||||
)
|
||||
|
||||
func Main(contents templ.Component, currentUser *model.User) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@ -27,6 +31,10 @@ func Main(contents templ.Component) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = LoginForm(currentUser).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = contents.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
Reference in New Issue
Block a user