Initial commit
This commit is contained in:
27
packages/auth/src/__seeds__/dev.ts
Normal file
27
packages/auth/src/__seeds__/dev.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { userFactory } from "../__factories__/user.factory";
|
||||
import type { User } from "../entities/models/user";
|
||||
|
||||
/**
|
||||
* Realistic auth seed for dev mode + storybook stories.
|
||||
*
|
||||
* Built from `userFactory` so factory defaults take care of boring fields
|
||||
* and we only override what makes the data look like a real user database.
|
||||
*
|
||||
* Lazily produced so importing this module is side-effect-free — the
|
||||
* factory's sequence counter only advances when a binder calls
|
||||
* `buildDevUsers()`.
|
||||
*/
|
||||
export function buildDevUsers(): User[] {
|
||||
return [
|
||||
userFactory.build({
|
||||
id: "alice",
|
||||
username: "alice",
|
||||
passwordHash: "hashed_secret_alice",
|
||||
}),
|
||||
userFactory.build({
|
||||
id: "bob",
|
||||
username: "bob",
|
||||
passwordHash: "hashed_secret_bob",
|
||||
}),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user