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