From 2b493e6d163f94d3201dc461cbef9429a6e2dd96 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 19 Oct 2024 18:05:20 +0200 Subject: [PATCH] Add default config values --- auth/config.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/auth/config.go b/auth/config.go index 1a509030..927a4827 100644 --- a/auth/config.go +++ b/auth/config.go @@ -20,6 +20,12 @@ type Configuration struct { ExpirationDelay time.Duration } +var DefaultConfig = Configuration{ + Issuer: "kyoo", + DefaultClaims: make(jwt.MapClaims), + ExpirationDelay: 30 * 24 * time.Hour, +} + const ( JwtPrivateKey = "jwt_private_key" ) @@ -31,7 +37,7 @@ func LoadConfiguration(db *dbc.Queries) (*Configuration, error) { return nil, err } - ret := Configuration{} + ret := DefaultConfig for _, conf := range confs { switch conf.Key {