Server IP : 66.29.132.124 / Your IP : 3.135.218.67 Web Server : LiteSpeed System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : wavevlvu ( 1524) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/wavevlvu/./book24.ng/vendor/laravel/fortify/src/Http/Controllers/ |
Upload File : |
<?php namespace Laravel\Fortify\Http\Controllers; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Routing\Controller; use Laravel\Fortify\Actions\GenerateNewRecoveryCodes; class RecoveryCodeController extends Controller { /** * Get the two factor authentication recovery codes for authenticated user. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function index(Request $request) { if (! $request->user()->two_factor_secret || ! $request->user()->two_factor_recovery_codes) { return []; } return response()->json(json_decode(decrypt( $request->user()->two_factor_recovery_codes ), true)); } /** * Generate a fresh set of two factor authentication recovery codes. * * @param \Illuminate\Http\Request $request * @param \Laravel\Fortify\Actions\GenerateNewRecoveryCodes $generate * @return \Illuminate\Http\Response */ public function store(Request $request, GenerateNewRecoveryCodes $generate) { $generate($request->user()); return $request->wantsJson() ? new JsonResponse('', 200) : back()->with('status', 'recovery-codes-generated'); } }