Initial commit of auth package.
This commit is contained in:
parent
5582bb6acd
commit
25e5119dd5
5 changed files with 99 additions and 9 deletions
19
controllers/logout.go
Normal file
19
controllers/logout.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package controllers
|
||||
|
||||
import (
|
||||
"goweb/auth"
|
||||
"goweb/msg"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type Logout struct {
|
||||
Controller
|
||||
}
|
||||
|
||||
func (l *Logout) Get(c echo.Context) error {
|
||||
if err := auth.Logout(c); err == nil {
|
||||
msg.Success(c, "You have been logged out successfully.")
|
||||
}
|
||||
return l.Redirect(c, "home")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue