Demo app: fix logout
This commit is contained in:
parent
4049896b99
commit
467116524d
@ -5,10 +5,8 @@ import (
|
||||
|
||||
oidc "forge.cadoles.com/wpetit/goweb-oidc"
|
||||
"forge.cadoles.com/wpetit/goweb-oidc/internal/config"
|
||||
"github.com/pkg/errors"
|
||||
"gitlab.com/wpetit/goweb/logger"
|
||||
"gitlab.com/wpetit/goweb/middleware/container"
|
||||
"gitlab.com/wpetit/goweb/service/session"
|
||||
)
|
||||
|
||||
func handleLogout(w http.ResponseWriter, r *http.Request) {
|
||||
@ -16,15 +14,6 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
|
||||
ctn := container.Must(ctx)
|
||||
conf := config.Must(ctn)
|
||||
|
||||
sess, err := session.Must(ctn).Get(w, r)
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "could not retrieve session"))
|
||||
}
|
||||
|
||||
if err := sess.Delete(w, r); err != nil {
|
||||
panic(errors.Wrap(err, "could not delete session"))
|
||||
}
|
||||
|
||||
client := oidc.Must(ctn)
|
||||
|
||||
logger.Info(
|
||||
|
Loading…
Reference in New Issue
Block a user