feat: SMS OTP auth + phone verification gate + improved login UI

- Usuario model: add isPhoneVerified field from is_phone_verified
- auth_provider.dart: fix access_token key, add _navigateAfterAuth gate
  (redirects to phoneLoginRoute if phone not verified), add verifyPhoneNumber,
  signInWithOTP, verifyPhoneNumberForLink, linkPhoneWithOTP methods
- phone_login_view.dart: full rewrite with logo, +57 prefix, two-step OTP flow
  (phone input → code input), 60s resend timer, email login fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-25 15:54:15 -05:00
co-authored by Claude Sonnet 4.6
parent f941270bd9
commit cc18246e1f
3 changed files with 265 additions and 108 deletions
+3
View File
@@ -12,6 +12,7 @@ class Usuario {
final String? gender;
final ProState proState;
final String? token;
final bool isPhoneVerified;
Usuario({
required this.id,
@@ -25,6 +26,7 @@ class Usuario {
required this.gender,
required this.proState,
required this.token,
this.isPhoneVerified = false,
});
Map<String, Object?> toDocument() {
@@ -56,6 +58,7 @@ class Usuario {
gender: doc['gender'],
proState: intToEnum((doc['professional_state'] as int?) ?? 0),
token: doc['token'],
isPhoneVerified: doc['is_phone_verified'] as bool? ?? false,
);
}