feat: Implement email verification flow for user registration, update API base URL, and refine agent search screen UI.

This commit is contained in:
pradeepkumar
2026-03-16 15:32:17 +05:30
parent 9512f5ef8d
commit e195696733
5 changed files with 14 additions and 17 deletions

View File

@@ -130,7 +130,9 @@ class AuthRepository {
}
}
Future<UserModel> register(RegisterRequest request) async {
/// Register returns { message, user } — no tokens.
/// The user must verify their email before logging in.
Future<Map<String, dynamic>> register(RegisterRequest request) async {
try {
final response = await _dio.post(
ApiConstants.authRegister,
@@ -138,14 +140,7 @@ class AuthRepository {
);
final data = response.data['data'] as Map<String, dynamic>;
final authResponse = AuthResponse.fromJson(data);
await SecureStorage.saveTokens(
accessToken: authResponse.accessToken,
refreshToken: authResponse.refreshToken,
);
return authResponse.user;
return data;
} on DioException catch (e) {
if (e.error is ApiException) {
throw e.error as ApiException;