Skip to content

Seed admin user from Config.json and fix config path case sensitivity for Linux - #1

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778169765-seed-admin-user
Open

devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1778169765-seed-admin-user

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 7, 2026

Copy link
Copy Markdown

Summary

Two changes:

  1. Configurable seed admin credentials (ERPService.cs): The first admin user created during initial DB setup now reads credentials from Config.json under a SeedUser section, with fallback to the original defaults (erp@webvella.com / erp). To use custom credentials, add to Config.json:

    "SeedUser": {
      "FirstName": "Demo",
      "LastName": "Admin",
      "Email": "demo@cognition.ai",
      "Password": "password123"
    }
  2. Linux case-sensitivity fix (Startup.cs, ErpMvcExtensions.cs): Changed config path from "config.json" to "Config.json" in both locations that load the config file, to match the actual filename on case-sensitive filesystems.

Review & Testing Checklist for Human

  • Verify ErpSettings.Configuration is always initialized before InitializeSystemEntities() runs — if not, the config reads will throw a NullReferenceException
  • Test with a fresh database (drop and recreate) both with and without the SeedUser section in Config.json — the fallback defaults should match the original behavior when the section is absent
  • Seeding only runs on first DB initialization (version 0). Changing Config.json after initial setup will not update the existing user — confirm this is acceptable

Suggested test plan: Drop the database, start the app with a SeedUser section in Config.json, verify login works with the configured credentials. Then drop the database again, remove the SeedUser section, and verify login works with the original defaults (erp@webvella.com / erp).

Notes

  • Config.json itself was not modified in this PR to avoid committing credentials to source control. The SeedUser section must be added manually to each deployment's config file.
  • The config.jsonConfig.json case fix is a no-op on Windows (case-insensitive) but required for Linux/macOS.
  • Tested end-to-end on a fresh database: login with demo@cognition.ai / password123 succeeded after adding the SeedUser section to the local Config.json.

Login page
Logged in dashboard

Link to Devin session: https://app.devin.ai/sessions/4869a007cd7540c8944b1a59d5a3b15d
Requested by: @patrickbradley-cog


Open in Devin Review

… sensitivity for Linux

Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: patrick.bradley <patrick.bradley@cognition.ai>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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