first commit
This commit is contained in:
commit
7cec3bb263
27 changed files with 597 additions and 0 deletions
19
helpers/session.go
Normal file
19
helpers/session.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package helpers
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/session"
|
||||
)
|
||||
|
||||
var store *session.Store
|
||||
var storeCreated bool
|
||||
|
||||
func GetSessionStore(c *fiber.Ctx) (*session.Session, error) {
|
||||
if !storeCreated {
|
||||
// TODO: Storage interface
|
||||
store = session.New()
|
||||
storeCreated = true
|
||||
}
|
||||
|
||||
return store.Get(c)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue