regitstation otp updated

This commit is contained in:
Hritikkk9
2024-04-11 19:12:16 +05:30
parent a66dacb22e
commit 16c6506d8c

View File

@@ -748,16 +748,19 @@ class AuthController extends Controller
//by hritik
//use - It will verify the OTPs of Asset Manager Registration
public function verifyContactAndEmailForAssetManagerApi(StoreAssetManagerRegistrationRequest $request)
public function verifyContactAndEmailForAssetManagerApi(Request $request)
{
try {
$isOtpVerificationFor = $request->isOtpVerificationFor;
$validated = $request->validated();
// $validated = $request->validated();
if ($isOtpVerificationFor == 1) {
$emailOtp = $request->email_otp;
$emailToAdd = $request->email2;
$userEmailOtpData = UserOtp::where('email', $emailToAdd)->where('otp', $emailOtp)->first(); // checking user email otp data
if (!$userEmailOtpData) {
return response()->json(['status' => 400, 'message' => 'Email OTP Did Not Matched!'], 400);
}
@@ -782,12 +785,12 @@ class AuthController extends Controller
$userCreated = User::create([
'name' => $validated['name2'],
'name' => $request->name2,
'user_type' => 'Asset Manager',
'authorized_representative_name' => $validated['authorized_representative_name'],
'email' => $validated['email2'],
'contact_number' => $validated['contact_number2'],
'password' => bcrypt($validated['password2']),
'authorized_representative_name' => $request->authorized_representative_name,
'email' => $request->email2,
'contact_number' => $request->contact_number2,
'password' => bcrypt($request->password2),
]);
if (!$userCreated) {
return response()->json(['status' => 400, 'message' => 'Error creating user!'])->setStatusCode(400);