Reorganized directories and packages.
This commit is contained in:
parent
965fb540c7
commit
dceb232cb2
61 changed files with 83 additions and 83 deletions
21
pkg/routes/logout.go
Normal file
21
pkg/routes/logout.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package routes
|
||||
|
||||
import (
|
||||
"github.com/mikestefanello/pagoda/pkg/controller"
|
||||
"github.com/mikestefanello/pagoda/pkg/msg"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type logout struct {
|
||||
controller.Controller
|
||||
}
|
||||
|
||||
func (l *logout) Get(c echo.Context) error {
|
||||
if err := l.Container.Auth.Logout(c); err == nil {
|
||||
msg.Success(c, "You have been logged out successfully.")
|
||||
} else {
|
||||
msg.Danger(c, "An error occurred. Please try again.")
|
||||
}
|
||||
return l.Redirect(c, "home")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue