🏗️ Return session store instead key
This commit is contained in:
parent
e096084726
commit
644ca6c78c
|
@ -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…
Reference in New Issue