xxxxxxxxxx
import 'package:firebase_auth/firebase_auth.dart';
import 'package:fluttertoast/fluttertoast.dart';
Future<void> sendOTP(String email) async {
FirebaseAuth auth = FirebaseAuth.instance;
// Send OTP to the provided email address
await auth.sendSignInWithEmailLink(
email: email,
handleCodeInApp: true,
url: 'https://your-project-url.com',
androidInstallIfNotAvailable: true,
iOSBundleID: 'your.ios.bundle.id',
);
Fluttertoast.showToast(
msg: 'OTP sent to $email',
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
);
}
Future<bool> verifyOTP(String email, String otp) async {
FirebaseAuth auth = FirebaseAuth.instance;
try {
// Sign in with the email and OTP
final UserCredential userCredential = await auth.signInWithEmailLink(
email: email,
emailLink: 'https://your-project-url.com',
);
return userCredential != null;
} catch (e) {
print('Error verifying OTP: $e');
return false;
}
}
xxxxxxxxxx
FirebaseAuth.instance.verifyPhoneNumber(
verificationCompleted: (phoneAuthCredential) {},
verificationFailed: (error) {},
codeSent: (verificationId, forceResendingToken) {},
codeAutoRetrievalTimeout: (verificationId) {},
phoneNumber: "Enter Phone Number",
);
xxxxxxxxxx
===================================
BEGIN LEAKED FIREBASE CONFIGURATION
===================================
apiKey: AIzaSyBIklC6-GUCwA9d_F8VRtKQQwkz6rX_ZEM
authDomain: platy-pixel-d07cd.firebaseapp.com
projectId: platy-pixel-d07cd
storageBucket: platy-pixel-d07cd.appspot.com
messagingSenderId: 172079264802
appId: 1:172079264802:web:9b5194bd5a6d566fe6067b
=================================
END LEAKED FIREBASE CONFIGURATION
=================================
xxxxxxxxxx
===================================
BEGIN LEAKED FIREBASE CONFIGURATION
===================================
apiKey: AIzaSyBIklC6-GUCwA9d_F8VRtKQQwkz6rX_ZEM
authDomain: platy-pixel-d07cd.firebaseapp.com
projectId: platy-pixel-d07cd
storageBucket: platy-pixel-d07cd.appspot.com
messagingSenderId: 172079264802
appId: 1:172079264802:web:9b5194bd5a6d566fe6067b
=================================
END LEAKED FIREBASE CONFIGURATION
=================================