saasitone/controllers/login.go

26 lines
417 B
Go
Raw Normal View History

2021-12-03 12:41:40 -08:00
package controllers
import (
2021-12-03 13:35:11 -08:00
"goweb/msg"
2021-12-03 12:41:40 -08:00
"github.com/labstack/echo/v4"
)
type Login struct {
Controller
}
func (l *Login) Get(c echo.Context) error {
p := NewPage(c)
p.Layout = "auth"
p.Name = "login"
p.Title = "Log in"
p.Data = "This is the login page"
return l.RenderPage(c, p)
}
2021-12-03 13:35:11 -08:00
func (l *Login) Post(c echo.Context) error {
msg.Danger(c, "Invalid credentials. Please try again.")
2021-12-03 13:35:11 -08:00
return l.Get(c)
}