@@ -694,6 +694,7 @@ class AuthController extends Controller
|
||||
|
||||
public function signUp2(StoreAssetManagerRegistrationRequest $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
$validated = $request->validated();
|
||||
if (!$request->has('g-recaptcha-response')) {
|
||||
|
||||
@@ -730,7 +731,7 @@ class AuthController extends Controller
|
||||
// 'contact_otp' => $mobile_otp //contact OTP
|
||||
// ]);
|
||||
|
||||
$insertOtp = RegistrationOtp::create([
|
||||
$insertOtp = RegistrationOtp::insertGetId([
|
||||
'contact_number'=>$request->contact_number2,
|
||||
// 'contact_otp'=>$mobile_otp,
|
||||
// 'contact_expire_at'=>Carbon::now()->addMinutes('4'),
|
||||
@@ -738,11 +739,12 @@ class AuthController extends Controller
|
||||
'email_otp'=>$otp,
|
||||
'email_expire_at'=>Carbon::now()->addMinutes('2'),
|
||||
]);
|
||||
// dd($insertOtp);
|
||||
|
||||
return response()->json(['status' => 200, 'message' => 'OTP has been sent to your Email & Contact no.']);
|
||||
} else {
|
||||
Session::forget('user-registration');
|
||||
$otp = $this->otpGenerate($request->email);
|
||||
$otp = $this->otpGenerate($request->email2);
|
||||
// $mobile_otp = $this->otpGenerate($validated['contact_number2']);
|
||||
$userRegistration = [
|
||||
'name' => $validated['name2'],
|
||||
@@ -759,9 +761,16 @@ class AuthController extends Controller
|
||||
'title' => 'Mail from ItSolutionStuff.com',
|
||||
'body' => 'This is for testing email using smtp.'
|
||||
];
|
||||
|
||||
$insertOtp = RegistrationOtp::insertGetId([
|
||||
'contact_number'=>$request->contact_number2,
|
||||
// 'contact_otp'=>$mobile_otp,
|
||||
// 'contact_expire_at'=>Carbon::now()->addMinutes('4'),
|
||||
'email'=>$request->email2,
|
||||
'email_otp'=>$otp,
|
||||
'email_expire_at'=>Carbon::now()->addMinutes('2'),
|
||||
]);
|
||||
Mail::to($validated['email2'])->send(new OtpMail($mailData, $otp));
|
||||
|
||||
|
||||
// $this->thirdPartyOTP($validated['contact_number2'], $mobile_otp);
|
||||
// Mail::to('yadavritikesh29@gmail.com')->send(new OtpMail($mailData, $otp));
|
||||
return response()->json(['status' => 200, 'message' => 'OTP has been sent to your email']);
|
||||
@@ -1322,4 +1331,4 @@ class AuthController extends Controller
|
||||
return $response;
|
||||
// return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,6 +234,7 @@ $.validator.addMethod("customEmail", function(value, element) {
|
||||
submitHandler: function (form) {
|
||||
var formData = new FormData(form);
|
||||
|
||||
|
||||
// $('#register_btn').text('Please wait...');
|
||||
|
||||
// $('#register_btn').attr('disabled',true);
|
||||
@@ -243,6 +244,9 @@ $.validator.addMethod("customEmail", function(value, element) {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
},
|
||||
});
|
||||
$("#register_btn_2").text("Please Wait....");
|
||||
$("#register_btn_2").attr("disabled", true);
|
||||
// return ;
|
||||
|
||||
$.ajax({
|
||||
// url: "api/register",
|
||||
@@ -250,6 +254,10 @@ $.validator.addMethod("customEmail", function(value, element) {
|
||||
|
||||
type: "POST",
|
||||
data: formData,
|
||||
beforeSend: function() {
|
||||
$("#register_btn_2").text("Please Wait....");
|
||||
$("#register_btn_2").attr("disabled", true);
|
||||
},
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType: "json",
|
||||
@@ -264,8 +272,9 @@ $.validator.addMethod("customEmail", function(value, element) {
|
||||
// customClass: { confirmButton: "btn yellow-btn popup-button" },
|
||||
// }).then(function (t) {
|
||||
// if (t.isConfirmed) {
|
||||
let url = "register_otp";
|
||||
|
||||
|
||||
let url = "register_otp";
|
||||
window.location.replace(url);
|
||||
// }
|
||||
// });
|
||||
|
||||
@@ -62,6 +62,10 @@ $(document).ready(function () {
|
||||
},
|
||||
});
|
||||
|
||||
$("#otp_send").text("Please Wait....");
|
||||
$("#otp_send").attr("disabled", true);
|
||||
// return;
|
||||
|
||||
$.ajax({
|
||||
url: "api/entered-email-otp",
|
||||
|
||||
@@ -71,6 +75,11 @@ $(document).ready(function () {
|
||||
otp: otp,
|
||||
},
|
||||
|
||||
beforeSend: function() {
|
||||
$("#otp_send").text("Please Wait....");
|
||||
$("#otp_send").attr("disabled", true);
|
||||
},
|
||||
|
||||
// dataType: 'json',
|
||||
|
||||
success: function (response) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<input type="text" id="input_3" class="otp"name="input_3" maxlength="1" />
|
||||
<input type="text" id="input_4" class="otp"name="input_4" maxlength="1" />
|
||||
<!--<input type="hidden" id="otp">-->
|
||||
<button type="submit" class="yellow-btn signin mt-2">Continue</button>
|
||||
<button type="submit" id="otp_send" class="yellow-btn signin mt-2">Continue</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user