mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor(server): print magic link on local dev env (#9864)
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
Get,
|
Get,
|
||||||
Header,
|
Header,
|
||||||
HttpStatus,
|
HttpStatus,
|
||||||
|
Logger,
|
||||||
Post,
|
Post,
|
||||||
Query,
|
Query,
|
||||||
Req,
|
Req,
|
||||||
@@ -56,6 +57,8 @@ const OTP_CACHE_KEY = (otp: string) => `magic-link-otp:${otp}`;
|
|||||||
@Throttle('strict')
|
@Throttle('strict')
|
||||||
@Controller('/api/auth')
|
@Controller('/api/auth')
|
||||||
export class AuthController {
|
export class AuthController {
|
||||||
|
private readonly logger = new Logger(AuthController.name);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly url: URLHelper,
|
private readonly url: URLHelper,
|
||||||
private readonly auth: AuthService,
|
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(
|
const result = await this.auth.sendSignInEmail(
|
||||||
email,
|
email,
|
||||||
|
|||||||
Reference in New Issue
Block a user