芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/www/vendor/laravel/fortify/src/Http/Requests/TwoFactorLoginRequest.php
'nullable|string', 'recovery_code' => 'nullable|string', ]; } /** * Determine if the request has a valid two factor code. * * @return bool */ public function hasValidCode() { return $this->code && tap(app(TwoFactorAuthenticationProvider::class)->verify( decrypt($this->challengedUser()->two_factor_secret), $this->code ), function ($result) { if ($result) { $this->session()->forget('login.id'); } }); } /** * Get the valid recovery code if one exists on the request. * * @return string|null */ public function validRecoveryCode() { if (! $this->recovery_code) { return; } return tap(collect($this->challengedUser()->recoveryCodes())->first(function ($code) { return hash_equals($code, $this->recovery_code) ? $code : null; }), function ($code) { if ($code) { $this->session()->forget('login.id'); } }); } /** * Determine if there is a challenged user in the current session. * * @return bool */ public function hasChallengedUser() { if ($this->challengedUser) { return true; } $model = app(StatefulGuard::class)->getProvider()->getModel(); return $this->session()->has('login.id') && $model::find($this->session()->get('login.id')); } /** * Get the user that is attempting the two factor challenge. * * @return mixed */ public function challengedUser() { if ($this->challengedUser) { return $this->challengedUser; } $model = app(StatefulGuard::class)->getProvider()->getModel(); if (! $this->session()->has('login.id') || ! $user = $model::find($this->session()->get('login.id'))) { throw new HttpResponseException( app(FailedTwoFactorLoginResponse::class)->toResponse($this) ); } return $this->challengedUser = $user; } /** * Determine if the user wanted to be remembered after login. * * @return bool */ public function remember() { if (! $this->remember) { $this->remember = $this->session()->pull('login.remember', false); } return $this->remember; } }