Skip to content

Allow + in email addresses for @kilocode.ai domain#26

Merged
markijbema merged 2 commits intomainfrom
session/agent_10e23a7f-947d-4d42-b643-bf0db45b0d79
Feb 5, 2026
Merged

Allow + in email addresses for @kilocode.ai domain#26
markijbema merged 2 commits intomainfrom
session/agent_10e23a7f-947d-4d42-b643-bf0db45b0d79

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot Bot commented Feb 5, 2026

Summary

This PR allows the + character in email addresses (email subaddressing like user+test@kilocode.ai) but only for emails with the @kilocode.ai domain.

Context

The team previously disabled + in email addresses to prevent abuse (people creating multiple accounts). However, for internal testing purposes, team members with @kilocode.ai emails should be able to use the + syntax to create test accounts (e.g., job+test1@kilocode.ai).

Changes

  • Modified validateMagicLinkSignupEmail to allow + for @kilocode.ai emails
  • Updated magicLinkSignupEmailSchema to allow + for @kilocode.ai emails
  • Added helper function isKilocodeDomain() to check if an email is from the kilocode.ai domain
  • Added tests for the new behavior

Fix: Strict Domain Matching

Fixed the isKilocodeDomain() helper to strictly match only @kilocode.ai domain. The previous implementation used endsWith("@kilocode.ai") which incorrectly allowed lookalike domains like @henkkilocode.ai to pass validation.

The fix extracts the domain portion after the @ symbol and compares it exactly:

  • job+test1@kilocode.ai ✅ allowed
  • mark+klaas@henkkilocode.ai ❌ rejected

Testing

  • Added test: should allow email with + character for @kilocode.ai domain (validateMagicLinkSignupEmail)
  • Added test: should reject uppercase @kilocode.ai email even with + (validateMagicLinkSignupEmail)
  • Added test: should reject email with + character for lookalike domains ending in kilocode.ai (validateMagicLinkSignupEmail)
  • Added test: should allow email with + character for @kilocode.ai domain (magicLinkSignupEmailSchema)
  • Added test: should reject email with + character for lookalike domains ending in kilocode.ai (magicLinkSignupEmailSchema)
  • Updated existing test names to clarify they apply to non-kilocode domains

Built for Mark by Kilo for Slack

- Modified validateMagicLinkSignupEmail to allow + for @kilocode.ai emails
- Updated magicLinkSignupEmailSchema to allow + for @kilocode.ai emails
- Added tests for the new behavior
- Kept restriction in place for all other domains
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot Bot commented Feb 5, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src/lib/schemas/email.ts
  • src/lib/schemas/email.test.ts

The previous implementation used endsWith('@kilocode.ai') which incorrectly
allowed emails like mark+klaas@henkkilocode.ai to pass validation.

Changed isKilocodeDomain() to extract the domain portion after the @ symbol
and compare it exactly against '@kilocode.ai'.

Added test cases for lookalike domains to prevent regression.
@markijbema markijbema requested a review from RSO February 5, 2026 11:11
@markijbema markijbema merged commit 71a104a into main Feb 5, 2026
11 checks passed
@markijbema markijbema deleted the session/agent_10e23a7f-947d-4d42-b643-bf0db45b0d79 branch February 5, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants