芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/app/Http/Controllers/User/OTPController.php
middleware('auth'); } public function showotpForm() { return view('user.otp'); } public function otp(Request $request) { $request->validate([ 'otp' => 'required' ]); $user = auth()->user(); $googleAuth = new GoogleAuthenticator(); $otp = $request->otp; $secret = $user->go; $oneCode = $googleAuth->getCode($secret); $userOtp = $otp; if ($oneCode == $userOtp) { $user->verified = 1; $user->save(); return redirect()->route('user.dashboard'); } else { return redirect()->back()->with('error','OTP not match!'); } } }