mirror of
https://github.com/janishutz/oidclogin.git
synced 2026-10-08 17:26:20 +02:00
feat: logout endpoint
This commit is contained in:
1 parent
a9245fd20f
commit
2ae92f8191
3 files changed
+10
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user