Skip to content

Restore error log in verifyEmail before next(error) #2295

@aalemayhu

Description

@aalemayhu

Non-blocking observation from the security review of #2289.

In src/controllers/UsersControllers.ts, the verifyEmail handler used to log the underlying error before forwarding to next(error):

```ts
} catch (error) {
console.error('Email verification failed:', error);
next(error);
}
```

That line was dropped during the rewrite. The current shape silently forwards:

```ts
} catch (error) {
next(error);
}
```

Not a security issue (the prior log was not load-bearing), but reduces diagnosability if verifyMagicToken ever throws (e.g., DB hiccup on the magic_tokens table). Restoring the log keeps the error visible in pm2 + Sentry without changing user-facing behavior.

One-line fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions