Fix Mock OTP

This commit is contained in:
R
2022-11-07 03:58:32 +07:00
parent 1d026c4c39
commit 20c323d91e

View File

@@ -75,7 +75,7 @@ class AuthController extends Controller
} }
return Helper::responseJson(data: [ return Helper::responseJson(data: [
'otp' => $user->otp, // 'otp' => $user->otp,
'otp_valid_until' => $user->otp_created_at->addMinutes(config('linksehat.otp_valid_minutes')) 'otp_valid_until' => $user->otp_created_at->addMinutes(config('linksehat.otp_valid_minutes'))
], message: 'OTP Terkirim'); ], message: 'OTP Terkirim');
} }
@@ -175,6 +175,7 @@ class AuthController extends Controller
$user = User::query()->where((filter_var($request->phone_or_email, FILTER_VALIDATE_EMAIL) ? 'email' : 'phone'), $request->phone_or_email)->firstOrFail(); $user = User::query()->where((filter_var($request->phone_or_email, FILTER_VALIDATE_EMAIL) ? 'email' : 'phone'), $request->phone_or_email)->firstOrFail();
return Helper::responseJson(data: [ return Helper::responseJson(data: [
'otp' => $user->otp,
'otp_valid_until' => $user->otp_created_at ? $user->otp_created_at->addMinutes(config('linksehat.otp_valid_minutes')) : null 'otp_valid_until' => $user->otp_created_at ? $user->otp_created_at->addMinutes(config('linksehat.otp_valid_minutes')) : null
], message: 'OTP Anda'); ], message: 'OTP Anda');
} }