Skip to content

feat: add one-click dev login buttons#304

Open
runleveldev wants to merge 1 commit into
mainfrom
rgingras/one-click-login-no-passport
Open

feat: add one-click dev login buttons#304
runleveldev wants to merge 1 commit into
mainfrom
rgingras/one-click-login-no-passport

Conversation

@runleveldev
Copy link
Copy Markdown
Collaborator

Show 'Login as Admin' and 'Login as User' buttons on the login page when NODE_ENV !== 'production'. Creates dev-admin/dev-user accounts on first use, bypassing password authentication. Buttons use the standard submit styling and the admin group is explicitly managed to prevent the first-user hook from granting unintended access.

image

Copilot Summary

This pull request introduces a development-only one-click login feature to streamline local testing and development. It adds a new /login/dev endpoint that allows developers to instantly log in as either an admin or a regular user, and updates the login page to display these options when not in production. There are also minor style adjustments to the signup section.

Development Experience Improvements:

  • Added a development-only /login/dev POST endpoint to login.js that creates or finds a test user (admin or regular) and logs them in, including proper group assignment. This is only enabled when NODE_ENV is not 'production'.
  • Updated the login view (login.ejs) to display "Login as Admin" and "Login as User" buttons for one-click development login when in development mode.

Styling Adjustments:

  • Changed .signup-section's margin-top from 1.5rem to 0 in style.css for improved layout, especially with the new dev login buttons.

Show 'Login as Admin' and 'Login as User' buttons on the login page
when NODE_ENV !== 'production'. Creates dev-admin/dev-user accounts
on first use, bypassing password authentication. Buttons use the
standard submit styling and the admin group is explicitly managed
to prevent the first-user hook from granting unintended access.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant