mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
fix(server): dev user configuration issue (#6619)
This commit is contained in:
@@ -78,10 +78,16 @@ export class AuthService implements OnApplicationBootstrap {
|
|||||||
async onApplicationBootstrap() {
|
async onApplicationBootstrap() {
|
||||||
if (this.config.node.dev) {
|
if (this.config.node.dev) {
|
||||||
try {
|
try {
|
||||||
const devUser = await this.signUp('Dev User', 'dev@affine.pro', 'dev');
|
const [email, name, pwd] = ['dev@affine.pro', 'Dev User', 'dev'];
|
||||||
if (devUser) {
|
let devUser = await this.user.findUserByEmail(email);
|
||||||
await this.quota.switchUserQuota(devUser?.id, QuotaType.ProPlanV1);
|
if (!devUser) {
|
||||||
|
devUser = await this.user.createUser({
|
||||||
|
email,
|
||||||
|
name,
|
||||||
|
password: await this.crypto.encryptPassword(pwd),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
await this.quota.switchUserQuota(devUser.id, QuotaType.ProPlanV1);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user