25-10-2/1
This commit is contained in:
@@ -7,6 +7,7 @@ import '../../../print.dart';
|
||||
import '../../views/auth/otp_page.dart';
|
||||
import '../../views/widgets/error_snakbar.dart';
|
||||
import '../functions/crud.dart';
|
||||
import '../functions/package_info.dart';
|
||||
import 'login_controller.dart';
|
||||
|
||||
// --- Helper Class for Phone Authentication ---
|
||||
@@ -83,6 +84,24 @@ class PhoneAuthHelper {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> _addTokens() async {
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
|
||||
await CRUD()
|
||||
.post(link: "${AppLink.server}/ride/firebase/add.php", payload: {
|
||||
'token': (box.read(BoxName.tokenFCM.toString())),
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
"fingerPrint": fingerPrint
|
||||
});
|
||||
await CRUD().post(
|
||||
link: "${AppLink.seferPaymentServer}/ride/firebase/add.php",
|
||||
payload: {
|
||||
'token': (box.read(BoxName.tokenFCM.toString())),
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
"fingerPrint": fingerPrint
|
||||
});
|
||||
}
|
||||
|
||||
static Future<void> registerUser({
|
||||
required String phoneNumber,
|
||||
required String firstName,
|
||||
@@ -102,6 +121,7 @@ class PhoneAuthHelper {
|
||||
final data = (response);
|
||||
if (data != 'failure') {
|
||||
// Registration successful, log user in
|
||||
await _addTokens();
|
||||
await _handleSuccessfulLogin(data['message']['data']);
|
||||
} else {
|
||||
mySnackeBarError(
|
||||
|
||||
Reference in New Issue
Block a user