diff --git a/.env.example b/.env.example index 4bec00e21..a2b2d8f9f 100644 --- a/.env.example +++ b/.env.example @@ -454,13 +454,15 @@ # AUTH_JWT_SECRET= ############################################################################### -# Access token lifetime +# Lifetime of the access token. Should be shorter than lifetime of the refresh token. # Type: time.Duration # Default: 2h # AUTH_OAUTH2_ACCESS_TOKEN_LIFETIME=2h ############################################################################### -# Refresh token lifetime +# Lifetime of the refresh token. Should be much longer than lifetime of the access token. +# +# Refresh tokens are used to exchange expired access tokens with new ones. # Type: time.Duration # Default: 72h # AUTH_OAUTH2_REFRESH_TOKEN_LIFETIME=72h @@ -523,13 +525,13 @@ # AUTH_SESSION_COOKIE_SECURE= ############################################################################### -# How long do we keep the temporary session +# Duration of the in /auth lasts when user logs-in without using "remember-me" option. # Type: time.Duration # Default: 24h # AUTH_SESSION_LIFETIME=24h ############################################################################### -# How long do we keep the permanent session +# Duration of the session in /auth lasts when user logs-in with "remember-me" option. # Type: time.Duration # Default: 8640h # AUTH_SESSION_PERM_LIFETIME=8640h diff --git a/app/options/auth.cue b/app/options/auth.cue index a861679fb..8bfd986ef 100644 --- a/app/options/auth.cue +++ b/app/options/auth.cue @@ -43,17 +43,23 @@ auth: schema.#optionsGroup & { env: "AUTH_JWT_SECRET" } access_token_lifetime: { - type: "time.Duration" - description: "Access token lifetime" - env: "AUTH_OAUTH2_ACCESS_TOKEN_LIFETIME" + type: "time.Duration" + description: """ + Lifetime of the access token. Should be shorter than lifetime of the refresh token. + """ + env: "AUTH_OAUTH2_ACCESS_TOKEN_LIFETIME" defaultGoExpr: "time.Hour * 2" defaultValue: "2h" } refresh_token_lifetime: { - type: "time.Duration" - description: "Refresh token lifetime" - env: "AUTH_OAUTH2_REFRESH_TOKEN_LIFETIME" + type: "time.Duration" + description: """ + Lifetime of the refresh token. Should be much longer than lifetime of the access token. + + Refresh tokens are used to exchange expired access tokens with new ones. + """ + env: "AUTH_OAUTH2_REFRESH_TOKEN_LIFETIME" defaultGoExpr: "time.Hour * 24 * 3" defaultValue: "72h" @@ -113,14 +119,19 @@ auth: schema.#optionsGroup & { description: "Defaults to true when HTTPS is used. Corteza will try to guess the this setting by" } session_lifetime: { - type: "time.Duration" - description: "How long do we keep the temporary session" + type: "time.Duration" + description: """ + Duration of the in /auth lasts when user logs-in without using \"remember-me\" option. + """ defaultGoExpr: "24 * time.Hour" defaultValue: "24h" } session_perm_lifetime: { - type: "time.Duration" - description: "How long do we keep the permanent session" + type: "time.Duration" + description: """ + Duration of the session in /auth lasts when user logs-in with \"remember-me\" option. + """ + defaultGoExpr: "360 * 24 * time.Hour" defaultValue: "8640h" }