mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
refactor(server): print magic link on local dev env (#9864)
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
Get,
|
||||
Header,
|
||||
HttpStatus,
|
||||
Logger,
|
||||
Post,
|
||||
Query,
|
||||
Req,
|
||||
@@ -56,6 +57,8 @@ const OTP_CACHE_KEY = (otp: string) => `magic-link-otp:${otp}`;
|
||||
@Throttle('strict')
|
||||
@Controller('/api/auth')
|
||||
export class AuthController {
|
||||
private readonly logger = new Logger(AuthController.name);
|
||||
|
||||
constructor(
|
||||
private readonly url: URLHelper,
|
||||
private readonly auth: AuthService,
|
||||
@@ -217,6 +220,10 @@ export class AuthController {
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
if (this.config.node.dev) {
|
||||
// make it easier to test in dev mode
|
||||
this.logger.debug(`Magic link: ${magicLink}`);
|
||||
}
|
||||
|
||||
const result = await this.auth.sendSignInEmail(
|
||||
email,
|
||||
|
||||
Reference in New Issue
Block a user