Files
Sage/.planning/phases/01-authentication/01-06-PLAN.md
Dani B 4a20b93fae fix(01): revise plans based on checker feedback
- Split Plan 05 (5 tasks → 2 tasks): password reset request interface
- Split Plan 06 (5 tasks → 2 tasks): created Plans 06-09 for focused scope
- Fixed Plan 06 wave assignment: Wave 4 → Wave 3 (depends only on Wave 2)
- Created Plan 07: password reset navigation and deep linking
- Created Plan 08: authentication pages error handling
- Created Plan 09: auth components error display and loading feedback
- Updated Plan 07 → Plan 10: logout and verification
- Updated ROADMAP.md with 10 plans in 4 waves
- All plans now have 2-3 tasks as recommended
2026-01-28 00:38:31 -05:00

111 lines
4.1 KiB
Markdown

---
phase: 01-authentication
plan: 06
type: execute
wave: 3
depends_on: ["01-05"]
files_modified: ["lib/features/authentication/presentation/pages/update_password_page.dart", "lib/features/authentication/data/repositories/auth_repository_impl.dart"]
autonomous: true
user_setup: []
must_haves:
truths:
- "Reset link redirects to password update page"
- "User can set new password successfully"
artifacts:
- path: "lib/features/authentication/presentation/pages/update_password_page.dart"
provides: "New password entry page"
min_lines: 40
- path: "lib/features/authentication/data/repositories/auth_repository_impl.dart"
provides: "Enhanced auth repository with password reset"
min_lines: 60
key_links:
- from: "lib/features/authentication/presentation/pages/update_password_page.dart"
to: "supabase.auth"
via: "password update flow"
pattern: "supabase\\.auth\\.updateUser|supabase\\.auth\\.resetPasswordForEmail"
---
<objective>
Implement password update page and enhance repository for complete reset flow.
Purpose: Enable users to set new passwords from reset email links with proper validation.
Output: Password update interface with deep link handling and repository enhancements.
</objective>
<execution_context>
@~/.opencode/get-shit-done/workflows/execute-plan.md
@~/.opencode/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/01-authentication/01-RESEARCH.md
</context>
<tasks>
<task type="auto">
<name>Create password update page</name>
<files>lib/features/authentication/presentation/pages/update_password_page.dart</files>
<action>
Create UpdatePasswordPage that:
1. Handles deep linking from password reset emails
2. Has new password input field with strength validation
3. Has confirm password field for validation
4. Uses AuthButton for "Update Password" action
5. Shows error messages for password mismatches
6. Shows loading state during password update
7. Navigates to login after successful password update
8. Handles expired/invalid reset tokens gracefully
9. Uses Supabase updateUser() method
10. Has proper error handling for various failure modes
11. Includes accessibility features
12. Has clear success messaging
13. Includes "Cancel" option to return to login
</action>
<verify>Password update page validates inputs, updates password successfully, and handles error cases</verify>
<done>Complete password update interface with deep link handling</done>
</task>
<task type="auto">
<name>Update auth repository for password reset</name>
<files>lib/features/authentication/data/repositories/auth_repository_impl.dart</files>
<action>
Extend AuthRepositoryImpl to:
1. Add updatePassword() method for new password setting
2. Handle password reset token verification
3. Improve resetPassword() method with proper redirect URL configuration
4. Add proper error handling for:
- Expired reset tokens
- Invalid reset tokens
- Weak passwords
- Network failures
5. Use supabase.auth.updateUser() for password updates
6. Ensure proper session handling after password update
7. Add comprehensive error mapping to custom exceptions
8. Include proper logging for debugging
</action>
<verify>Repository methods handle password reset flow from email to completion</verify>
<done>Enhanced auth repository with complete password reset functionality</done>
</task>
</tasks>
<verification>
1. Password update page validates inputs and updates password successfully
2. Reset email contains working deep link to password update page
3. Error handling covers all failure scenarios (expired tokens, weak passwords, etc.)
4. Deep linking works on both mobile and web platforms
5. Navigation flows correctly from password update to login
</verification>
<success_criteria>
Password update system working with deep link handling, validation, and repository integration.
</success_criteria>
<output>
After completion, create `.planning/phases/01-authentication/01-06-SUMMARY.md`
</output>