feat: logout endpoint

This commit is contained in:
janishutz committed 2026-09-21 16:15:40 +02:00
1 parent a9245fd20f
commit 2ae92f8191
3 files changed
+10

No files matched your search

+8
View File
@@ -122,6 +122,14 @@ func callbackHandler(c *gin.Context) {
}
}
func logoutHandler(c *gin.Context) {
session := sessions.Default(c)
session.Clear()
session.Save()
}
// Ensure that a user is currently logged in.
// If redirectFail is set, then if not, the user is redirected.
func EnsureLogin(redirectFail bool) func(c *gin.Context) {
return (func(c *gin.Context) {
session := sessions.Default(c)