feat(auth): add logging for user registration and activation email process

- Introduced console logging to track the registration flow, including the generated activation code and confirmation of user creation and email sending.
- This enhancement aids in debugging and monitoring the registration process without altering the existing functionality.
This commit is contained in:
Torsten Schulz (local)
2026-02-04 11:53:28 +01:00
parent c2dbf0a12d
commit a86c05eb66

View File

@@ -8,12 +8,15 @@ import { devLog, errorLog } from '../utils/logger.js';
const register = async (email, password) => {
try {
console.log('register', email, password);
const activationCode = Math.random().toString(36).substring(2, 15);
console.log('activationCode', activationCode);
await User.create({ email, password, activationCode });
console.log('User created');
// AktivierungsE-Mail versenden
await sendActivationEmail(email, activationCode);
console.log('Activation email sent');
// Aufrufer bekommt absichtlich KEINE Userdaten zurück (siehe Controller)
return;
} catch (error) {