mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-24 23:04:43 +01:00
added sessions and flash storage
This commit is contained in:
16
middleware/session.go
Normal file
16
middleware/session.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/lukerodham/tuu"
|
||||
)
|
||||
|
||||
func SessionSaver(next tuu.Handler) Handler {
|
||||
return func(c tuu.Context) error {
|
||||
err := next(c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.Session().Save()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user