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
{{ message }}
Repository navigation
Allow users + tests to sign in to multiple users #54751
platform: apiServer application that needs familiarity with Express, Fastify, MongoDB etc.status: discussingUnder discussion threads. Closed as stale after 60 days of inactivity.
Api responds, setting the access token cookie jwt_access_token to allow access to the [email protected] account
This means changing accounts is a convoluted process:
Modify the database so that a different user has the [email protected] email address (e.g. use pnpm seed:certified-user)
Delete the jwt_access_token cookie
Sign in again
The main benefit of this is that it's quick to get started. As a contributor, I only need to click on the "Sign in" button and I'm in.
Handling multiple accounts
I propose we modify the learn client and server to allow the client to change user without the contributor having to directly modify the database (no need to seed). To do this we could:
Create a dev-only POST endpoint, /dev-signin, that accepts a payload of { email: string } and signs you in to that user, if they exist
Create a dev-only page on the client that provides a simple UI to make those requests.
A simple dropdown with a submit button should be enough. If the developmentuser is selected by default, then signing in is still pretty quick. The only addition is that you'd have to press enter when you arrive on the sign in page.
I think the first method, creating a dev signin, is the simpler approach and this way we can login as any user for development and the tests. Also we won't have to make any major modifications in the UI as when we go the way of decoupling the frontend with the API with respect to auth there won't be any changes needed to be done here other than a "if" check
platform: apiServer application that needs familiarity with Express, Fastify, MongoDB etc.status: discussingUnder discussion threads. Closed as stale after 60 days of inactivity.
Activity
Nirajn2311 commentedon Jan 30, 2025
I think the first method, creating a dev signin, is the simpler approach and this way we can login as any user for development and the tests. Also we won't have to make any major modifications in the UI as when we go the way of decoupling the frontend with the API with respect to auth there won't be any changes needed to be done here other than a "if" check
jdwilkin4 commentedon Nov 21, 2025
As discussed in the staff chat, I am closing this due to inactivity.
If you wish to reopen it and work on, then feel free to reopen 👍🏾