OpenContracts icon indicating copy to clipboard operation
OpenContracts copied to clipboard

Local Development server

Open amirshaneh opened this issue 9 months ago • 2 comments

I've followed the quick start steps to run a local server. I guess its also missing setting up POSTGRES_PASSWORD in .postgres env, since it cannot be empty (won't run without it) and also DJANGO_SECRET_KEY in .django env. but even after everything is up and running. I'm able to login using admin credentials but whenever I'm trying to create anything (corpus doc etc..) i get the following error from the graphql request. "You do not have permission to perform this action".

I've accessed django admin panel and double checked all my user permission and so on...

any suggestion on how to resolve this issue?

amirshaneh avatar Mar 29 '25 20:03 amirshaneh

@JSv4 after some tinkering about I found the issue and would like to know if its a valid issue for local development. in config/settings/base.py the current code only sets JSONWebTokenMiddleware to GRAPHENE_MIDDLEWARE if USE_AUTH0. if I always add JSONWebTokenMiddleware it seems to be working as expected...

amirshaneh avatar Mar 31 '25 13:03 amirshaneh

Hey @amirshaneh, I ran into similar issue that is being fixed in pending PR (expected merge in a few days max). For starters, make sure USE_API_KEY_AUTH is set to False as the API token middleware was not playing nice with the JSON token auth. If you're not using auth0 auth (and are using tokens issued by the backend itself), you don't want to set USE_AUTH0=True.

Will also re-review the getting started guide and see if I can clean up the instructions.

JSv4 avatar Apr 02 '25 06:04 JSv4