feat: change user controller for iran access

This commit is contained in:
2026-04-19 12:22:24 +00:00
parent bc86c41578
commit ae6b32a0b2
+16 -16
View File
@@ -231,21 +231,21 @@ public function register(Request $request)
$code = rand(1000, 9999);
$token = Str::random(64);
// ✅ Check if email can receive a message before creating the user
if (isset($data['email'])) {
$code = rand(1000, 9999);
try {
if ($method === 'code') {
\Mail::to($data['email'])->send(new \App\Mail\VerifyEmailCodeMail($code));
} else {
$verificationUrl = url("api/auth/verify-email-link/{$token}?package={$packageNameValue}");
\Mail::to($data['email'])->send(new \App\Mail\VerifyEmailLinkMail($verificationUrl));
}
} catch (\Exception $e) {
return response()->json([
'error' => $e->getMessage(),
'message' => 'لطفا آدرس ایمیل خود را بررسی کنید و مجدد تلاش کنید'
], 400);
}
// if (isset($data['email'])) {
// $code = rand(1000, 9999);
// try {
// if ($method === 'code') {
// \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailCodeMail($code));
// } else {
// $verificationUrl = url("api/auth/verify-email-link/{$token}?package={$packageNameValue}");
// \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailLinkMail($verificationUrl));
// }
// } catch (\Exception $e) {
// return response()->json([
// 'error' => $e->getMessage(),
// 'message' => 'لطفا آدرس ایمیل خود را بررسی کنید و مجدد تلاش کنید'
// ], 400);
// }
// try {
// // Try sending email
// \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailCodeMail($code));
@@ -257,7 +257,7 @@ public function register(Request $request)
// ], 400);
// }
}
// }
// Hash password
$data['password'] = isset($data['password'])