Renamed controllers package to routes.
This commit is contained in:
parent
60dedc0944
commit
869c507737
11 changed files with 12 additions and 12 deletions
20
routes/logout.go
Normal file
20
routes/logout.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package routes
|
||||
|
||||
import (
|
||||
"goweb/auth"
|
||||
"goweb/controller"
|
||||
"goweb/msg"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type Logout struct {
|
||||
controller.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