photoprism/internal/service/session.go
Michael Mayer 323d495840 Auth: Apply user rights and permissions in the search API #98 #782
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-30 00:42:19 +02:00

21 lines
343 B
Go

package service
import (
"sync"
"github.com/photoprism/photoprism/internal/session"
)
var onceSession sync.Once
func initSession() {
// Sessions are valid for 7 days by default.
services.Session = session.New(session.ExpiresAfter, Config())
}
func Session() *session.Session {
onceSession.Do(initSession)
return services.Session
}