🏗️ Return session store instead key

This commit is contained in:
Maxim Lebedev 2022-01-05 16:48:02 +05:00
parent e096084726
commit 644ca6c78c
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 2 additions and 2 deletions

View File

@ -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
}