mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
20 lines
458 B
Go
20 lines
458 B
Go
package handlers
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/clems4ever/authelia/middlewares"
|
|
)
|
|
|
|
// LogoutPost is the handler logging out the user attached to the given cookie.
|
|
func LogoutPost(ctx *middlewares.AutheliaCtx) {
|
|
ctx.Logger.Tracef("Destroy session")
|
|
err := ctx.Providers.SessionProvider.DestroySession(ctx.RequestCtx)
|
|
|
|
if err != nil {
|
|
ctx.Error(fmt.Errorf("Unable to destroy session during logout: %s", err), operationFailedMessage)
|
|
}
|
|
|
|
ctx.ReplyOK()
|
|
}
|