🏗️ Return session store instead key

master v0.5.0
Maxim Lebedev 1 year ago
parent e096084726
commit 644ca6c78c
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5

@ -60,11 +60,11 @@ func SessionWithConfig(config SessionConfig) Interceptor {
}
// SessionGet returns a named session.
func SessionGet(ctx *http.RequestCtx, name string) (interface{}, error) {
func SessionGet(ctx *http.RequestCtx, name string) (*session.Store, error) {
store, ok := ctx.UserValue(key).(*session.Store)
if !ok {
return nil, fmt.Errorf("%s session store not found", key)
}
return store.Get(name), nil
return store, nil
}

Loading…
Cancel
Save