Update: 2026-07-21 20:40:48
This commit is contained in:
@@ -6,6 +6,7 @@ import '../../../print.dart';
|
||||
import '../../views/auth/otp_page.dart';
|
||||
import '../../views/widgets/error_snakbar.dart';
|
||||
import '../functions/crud.dart';
|
||||
import '../functions/encrypt_decrypt.dart';
|
||||
import '../functions/package_info.dart';
|
||||
import '../functions/country_logic.dart';
|
||||
import 'login_controller.dart';
|
||||
@@ -16,7 +17,8 @@ class PhoneAuthHelper {
|
||||
// Define your server URLs
|
||||
static final String _sendOtpUrl = '${AppLink.server}/auth/otp/request.php';
|
||||
static final String _verifyOtpUrl = '${AppLink.server}/auth/otp/verify.php';
|
||||
static final String _registerUrl = '${AppLink.server}/auth/passenger/register.php';
|
||||
static final String _registerUrl =
|
||||
'${AppLink.server}/auth/passenger/register.php';
|
||||
|
||||
// removed formatSyrianPhone
|
||||
|
||||
@@ -82,6 +84,14 @@ class PhoneAuthHelper {
|
||||
Log.print('isRegistered: ${isRegistered}');
|
||||
|
||||
if (isRegistered) {
|
||||
final jwtToken = data['message']?['jwt'] ??
|
||||
data['message']?['token'] ??
|
||||
data['message']?['access_token'];
|
||||
if (jwtToken != null && jwtToken.toString().isNotEmpty) {
|
||||
box.write(BoxName.jwt, (jwtToken.toString()));
|
||||
await storage.write(
|
||||
key: BoxName.jwt, value: (jwtToken.toString()));
|
||||
}
|
||||
// ✅ المستخدم موجود مسبقاً -> تسجيل دخول مباشر
|
||||
await _handleSuccessfulLogin(data['message']['passenger']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user