Skip to content

Conversation

@dpickett
Copy link
Member

Summary

Implements a flexible schema factory for password-based authentication that supports configurable identifier types with compile-time type safety.

Changes

  • ✨ Added createPasswordIdentitySchema factory function
  • 🔧 Support for email, username, and phone identifiers
  • 📝 Compile-time type safety with as const arrays
  • 🧪 Comprehensive test coverage for all combinations
  • 📚 Updated user story documentation

Usage

// Email only
const schema = createPasswordIdentitySchema(['email'] as const);

// Multiple identifiers with custom validation
const schema = createPasswordIdentitySchema(['email', 'phone'] as const, {
  phone: z.string().regex(/^\+1[0-9]{10}$/)
});

Test Plan

  • All identifier combinations tested
  • Custom schema validation verified
  • Type safety confirmed at compile time
  • Documentation updated with examples

Closes #2

🤖 Generated with Claude Code

@dpickett dpickett force-pushed the 2-configurable-password-identity-schema branch 6 times, most recently from a0bb0c1 to 732636a Compare July 12, 2025 02:50
- Add createPasswordIdentitySchema with email, username, phone support
- Compile-time type safety with readonly arrays and const assertions
- Custom validation schemas for each identifier type
- Comprehensive test coverage for all identifier combinations
- Update user story documentation with phone identifier examples

Closes #2

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dpickett dpickett force-pushed the 2-configurable-password-identity-schema branch from 732636a to 79f2d1c Compare July 12, 2025 02:53
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.

Implement configurable PasswordIdentity schema factory

2 participants