1.3 KiB
1.3 KiB
I will implement the missing Authentication features (Phase 1 of the Roadmap): Password Reset and Email Confirmation.
1. Update auth Crate
I will modify auth/src/handlers.rs and auth/src/lib.rs to add the following endpoints:
POST /recover: Initiates the password reset flow.- Generates a recovery token.
- (Mock) Sends a recovery email.
POST /verify: Verifies email confirmation or recovery tokens.- Supports
typeparameter (signup,recovery,magiclink,invite). - Updates
email_confirmed_ator returns a session for recovery.
- Supports
PUT /user: Allows authenticated users to update their password and metadata.
2. Update auth Models
I will update auth/src/models.rs to include:
RecoverRequeststruct.VerifyRequeststruct.UserUpdateRequeststruct.
3. Update auth Utilities
I will update auth/src/utils.rs to include helper functions for:
- Generating random tokens (for recovery/confirmation).
4. Integration Tests
I will add new tests to tests/integration/auth.test.ts to verify:
- Password recovery flow (request -> verify -> update password).
- Email confirmation flow (signup -> verify).
This completes Phase 1 of the roadmap. Future phases (Realtime, Storage, Edge Functions) will be addressed in subsequent steps.