Skip to content

Commit 9b55b02

Browse files
committed
Add default superadmin user creation on first run
- Create default superadmin when database is empty on first startup - Email: first configured superadmin email or admin@localhost - Password: Password123! (with MustChangePassword flag) - Add MustChangePassword field to User entity and DTOs - Add PasswordChangeAlert banner in Blazor app when user needs to change password - Clear MustChangePassword flag after successful password change - Update deploy README with first run documentation
1 parent 4ece85b commit 9b55b02

12 files changed

Lines changed: 2624 additions & 2 deletions

File tree

cloud/deploy/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,32 @@ location /health {
243243
./deploy.sh
244244
```
245245

246+
## First Run - Default Admin User
247+
248+
On first startup with an empty database, LRM Cloud automatically creates a default superadmin user:
249+
250+
| Field | Value |
251+
|-------|-------|
252+
| **Email** | First email from `superAdmin.emails` config, or `admin@localhost` if not configured |
253+
| **Password** | `Password123!` |
254+
| **Username** | `admin` |
255+
256+
**Important:**
257+
- The credentials are logged to the console on first run with a warning to change the password
258+
- After logging in, a yellow alert banner will appear prompting you to change the password
259+
- Navigate to **Settings > Profile** to change your password
260+
- The alert will disappear after you change your password
261+
262+
To pre-configure a superadmin email, add it to `config.json` before first run:
263+
264+
```json
265+
{
266+
"superAdmin": {
267+
"emails": ["[email protected]"]
268+
}
269+
}
270+
```
271+
246272
## Scripts
247273

248274
### setup.sh - Initial Setup

0 commit comments

Comments
 (0)