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:
@@ -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');
|
||||
|
||||
// Aktivierungs‑E-Mail versenden
|
||||
await sendActivationEmail(email, activationCode);
|
||||
|
||||
console.log('Activation email sent');
|
||||
// Aufrufer bekommt absichtlich KEINE Userdaten zurück (siehe Controller)
|
||||
return;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user