photoprism/internal/service/oidc.go

23 lines
358 B
Go
Raw Normal View History

2021-09-08 12:17:44 +02:00
package service
import (
2021-09-08 14:41:28 +02:00
"github.com/photoprism/photoprism/internal/oidc"
2021-09-08 12:17:44 +02:00
)
func initOidc() {
services.Oidc = oidc.NewClient(
Config().OidcIssuerUrl(),
Config().OidcClientId(),
Config().OidcClientSecret(),
Config().SiteUrl(),
2021-09-08 14:41:28 +02:00
Config().Debug(),
2021-09-08 12:17:44 +02:00
)
}
func Oidc() *oidc.Client {
if services.Oidc == nil {
initOidc()
}
2021-09-08 12:17:44 +02:00
return services.Oidc
}