Skip to content

Conversation

@initstring
Copy link
Owner

Motivation

  • Ensure that the env-specified INITIAL_ADMIN_EMAIL admin account is present on every initialization so an SSO-configured admin can sign in even if demo mode previously seeded a different account, while preserving the policy that SSO does not auto-create arbitrary users.

Description

  • Always upsert the bootstrap admin during initialization by changing src/server/init/ensure-initialized.ts to unconditionally upsert the INITIAL_ADMIN_EMAIL, and update the unit test in src/test/init.test.ts to match the new behavior.

Testing

  • Updated the unit test src/test/init.test.ts to assert the unconditional upsert of the bootstrap admin, and no automated test runs were executed as part of this change.

Codex Task

@initstring
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d61923c7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@initstring
Copy link
Owner Author

This MR fixes the plausible edge case where:

  • someone tests in demo mode
  • they then implement SSO with a real email
  • they update the env file
  • initial admin user not created again, as it already exists in DB
  • user cannot log in

I tested manually and it works well now.

@initstring initstring merged commit f181ced into main Jan 17, 2026
5 checks passed
@initstring initstring deleted the codex/investigate-sso-user-creation-implications branch January 17, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants