auth
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { IMagicLinkNotificationPort, MagicLinkNotificationInput } from '@core/identity/domain/ports/IMagicLinkNotificationPort';
|
||||
import { Logger } from '@core/shared/application';
|
||||
|
||||
/**
|
||||
* Console adapter for magic link notifications
|
||||
* Logs to console for development/testing purposes
|
||||
*/
|
||||
export class ConsoleMagicLinkNotificationAdapter implements IMagicLinkNotificationPort {
|
||||
constructor(private readonly logger: Logger) {}
|
||||
|
||||
async sendMagicLink(input: MagicLinkNotificationInput): Promise<void> {
|
||||
this.logger.info('[ConsoleMagicLinkNotificationAdapter] Magic link generated', {
|
||||
email: input.email,
|
||||
userId: input.userId,
|
||||
magicLink: input.magicLink,
|
||||
expiresAt: input.expiresAt,
|
||||
});
|
||||
|
||||
// In development, log to console
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
console.log('\n🔒 PASSWORD RESET MAGIC LINK');
|
||||
console.log('='.repeat(50));
|
||||
console.log(`📧 Email: ${input.email}`);
|
||||
console.log(`👤 User ID: ${input.userId}`);
|
||||
console.log(`🔗 Link: ${input.magicLink}`);
|
||||
console.log(`⏰ Expires: ${input.expiresAt.toLocaleString()}`);
|
||||
console.log('='.repeat(50));
|
||||
console.log('⚠️ This would be sent via email in production\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user