You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#171 will implement arbitrary subdirectory loading by prepending links and routes with the value from the homepage directive in package.json at build time.
For refresh tokens to work in arbitrary subfolders, the JWT_REFRESH_COOKIE_PATH of Flask JWT Extended needs to contain the same value as the homepage directive. Otherwise, users can login but cannot refresh their tokens.
The text was updated successfully, but these errors were encountered:
With the API moving to its own repo and being installed as a standalone package, this should be managed via environment variable files. Does the dotenv support loading files from specific paths? If so, the same environment variable from the frontend can be used to sync this together.
A potential fallback is that this configuration is managed through deployment scripts.
# settings.pyfromdotenvimportload_dotenvload_dotenv()
# OR, the same with increased verbosityload_dotenv(verbose=True)
# OR, explicitly providing path to '.env'frompathlibimportPath# Python 3.6+ onlyenv_path=Path('.') /'.env'load_dotenv(dotenv_path=env_path)
It looks like when calling load_dotenv, it is possible to specify the path to the .env file, in the example above, it just so happens to be the same directory that settings.py is in: ./.env.
This particular example uses settings.py as the script that loads the .env file, but I think It is far more useful to us if setup.py makes use of load_dotenv, this way some of the variables from the frontend and the backend can be synchrounous
Possible issues
There will have to be .env file present on the target device in order for the setup.py to work. While this is an assumption, if it is something that can be reasonably maintained and be present every time the package needs to be installed, then there shouldn't be issues when trying to install the package. However, the .env file must be present, otherwise, the package installation will fail, or the package will have to rely on a set of default values, neither option being significantly better than the other.
Using dotenv in setup.py isn't reliable because dotenv isn't part of the standard library. Instead, the configuration options for the API should be exposed in a similar fashion to Flask apps. dotenv can be used by the client to set these exposed values.
#171 will implement arbitrary subdirectory loading by prepending links and routes with the value from the
homepage
directive inpackage.json
at build time.For refresh tokens to work in arbitrary subfolders, the
JWT_REFRESH_COOKIE_PATH
of Flask JWT Extended needs to contain the same value as thehomepage
directive. Otherwise, users can login but cannot refresh their tokens.The text was updated successfully, but these errors were encountered: