2020-04-20 13:50:28 +02:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/session"
|
|
|
|
)
|
|
|
|
|
|
|
|
var onceSession sync.Once
|
|
|
|
|
|
|
|
func initSession() {
|
2022-09-28 09:01:17 +02:00
|
|
|
// Sessions are valid for 7 days by default.
|
2022-09-30 00:42:19 +02:00
|
|
|
services.Session = session.New(session.ExpiresAfter, Config())
|
2020-04-20 13:50:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func Session() *session.Session {
|
|
|
|
onceSession.Do(initSession)
|
|
|
|
|
|
|
|
return services.Session
|
|
|
|
}
|