The way Nuxt handles environment variables is weird. Document this to help others from not falling into its pitfalls.
21 lines
1.4 KiB
Markdown
21 lines
1.4 KiB
Markdown
<!--
|
|
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
-->
|
|
# Configuration
|
|
|
|
## Quoting
|
|
|
|
Environment variables are parsed using [destr](https://github.com/unjs/destr) which contain arbitrary unspecified and undocumented rules for converting strings to data. If an environment input looks like JSON it'll most likely be parsed as JSON and my cause a type missmatch error to be reported. To avoid strings being converted into other unintended values put the value into `"` marks. Depending on your configuration environment you may have to double up the quotation marks and/or use escapes.
|
|
|
|
## Environment Variables
|
|
|
|
### NUXT_SESSION_ROTATES_TIMEOUT
|
|
|
|
Time in seconds before a session need to be rotated over into a new session. When an endpoint using a session is hit after the session rotates timeout but before the session is discarded a new session is created as the successor with a new rotates and discard timeout. The old session then marked to expire in 10 seconds any requests using the old session will result in a 403 Forbidden with the message the session has been taken after the expiry.
|
|
|
|
### NUXT_SESSION_DISCARD_TIMEOUT
|
|
|
|
Time in seconds before a session is deleted from the client and server, resulting in the user having to authenticate again if the session wasn't rotated over into a new session before this timeout.
|
|
|
|
This should be several times greater that `NUXT_SESSION_ROTATES_TIMEOUT`.
|