feat(email): notify users of new API keys#79
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15ff3e7d56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| user_id, | ||
| ) | ||
| else: | ||
| await email_service.send_created_email(user, created) |
There was a problem hiding this comment.
Return the one-time key before awaiting SES
When SES is configured but slow or temporarily unreachable, this await keeps the create request open after ApiKeyRepository.create_api_key has already committed the row. The frontend only reveals the plaintext key from this response (frontend/src/app/settings/api-keys/page.tsx), so a route/client timeout here leaves the user with an active API key whose secret can never be recovered. Send the notification out of band or otherwise avoid blocking the one-time secret response on SES delivery.
Useful? React with 👍 / 👎.
What changed
Why
Users should be alerted when credentials are created for their account so unexpected activity can be detected and revoked quickly.
Validation
git diff --checkpassedpydantic-aiandgriffe