22 lines
451 B
Go
22 lines
451 B
Go
package routes
|
|
|
|
import (
|
|
"github.com/mikestefanello/pagoda/controller"
|
|
"github.com/mikestefanello/pagoda/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")
|
|
}
|