Handle logout
This commit is contained in:
parent
d217d1c14b
commit
aa34c6ef4c
2 changed files with 21 additions and 0 deletions
20
controllers/logout.go
Normal file
20
controllers/logout.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package controllers
|
||||
|
||||
import (
|
||||
"git.readonly.ch/bouzoure/popvaud-people/helpers"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func LogoutProcess(c *fiber.Ctx) error {
|
||||
sess, err := helpers.GetSessionStore(c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = sess.Destroy()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.Redirect("/")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue