feat(core): desktop multiple server support (#8979)

This commit is contained in:
EYHN
2024-12-03 05:51:09 +00:00
parent af81c95b85
commit 8963826463
137 changed files with 2052 additions and 1694 deletions

View File

@@ -35,6 +35,7 @@ import { TokenService, TokenType } from './token';
interface PreflightResponse {
registered: boolean;
hasPassword: boolean;
magicLink: boolean;
}
interface SignInCredential {
@@ -82,16 +83,20 @@ export class AuthController {
params.email
);
const magicLinkAvailable = !!this.config.mailer.host;
if (!user) {
return {
registered: false,
hasPassword: false,
magicLink: magicLinkAvailable,
};
}
return {
registered: user.registered,
hasPassword: !!user.password,
magicLink: magicLinkAvailable,
};
}

View File

@@ -8,7 +8,7 @@ import { createApp } from './app';
import { URLHelper } from './fundamentals';
const app = await createApp();
const listeningHost = AFFiNE.deploy ? '0.0.0.0' : 'localhost';
const listeningHost = '0.0.0.0';
await app.listen(AFFiNE.server.port, listeningHost);
const url = app.get(URLHelper);