-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement developer authentication bypass for local development #267
Comments
I was facing the same issue and realized that the implementation solves the graphql checks, but not the ones in the open-tacos Nextjs app. Couple of suggestions here at various levels of mocking:
|
How about introducing a really simple bypass switch that only works in |
When I wrote up this issue, I described that the problem we're addressing is specifically for bypassing authentication in open-tacos. Now I realize that my solution really is specifically usefull for backend authentication and it does nothing to help someone on the front end, who will be blocked by the authentication window pop-up. I think that my suggestions in this issue would still be useful for backend development tasks that require bypassing authentication. I am going to edit the title and descrcription of this issue, then write up another issue that deals specifically with the task of front end authentication. |
Note: This description has been edited. It originally (accidentally) blended front end and backend authentication into a single issue. I will link to the front end authentication bypass issue here, as soon as I write up that issue.
The Problem:
As developers working on the openbeta-graphql project, we need a convenient way to bypass the authentication system when running the server locally. This will allow us to test/develop functionality without having to provide real user credentials. Note that this issue describes creating test/dev accounts which could probably be used to authenticate backend request for dev purposes, but I think that process would be clunky and it is probably best not to rely on that strategy.
Proposed Solution Overview:
Allow contributors to bypass the authentication system when running the app locally. We'll achieve this by setting a new,
NODE_ENV
environment variable to"development"
when running a newserve-dev
command, which will run the app in development mode.Implementation Details:
serve-dev
in package.json:build/auth/middleware.js
to bypass the authentication process whenprocess.env.NODE_ENV
is set to development. Assign 'admin' and 'editor' roles to the user in this case.createContext
function.Acceptance Criteria:
serve-dev
should be available for running the app in development mode.createContext
function should be covered by tests.The text was updated successfully, but these errors were encountered: