WebAuthn登录初步调通
This commit is contained in:
parent
6e4faf0865
commit
f32c2e6344
@ -7,9 +7,9 @@ use App\WebAuthn\WebAuthnService;
|
||||
use Cose\Algorithm\Manager;
|
||||
use Cose\Algorithm\Signature\ECDSA\ES256;
|
||||
use Cose\Algorithm\Signature\RSA\RS256;
|
||||
use Cose\Algorithms;
|
||||
use GuzzleHttp\Psr7\ServerRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Webauthn\AttestationStatement\AttestationObjectLoader;
|
||||
@ -115,10 +115,15 @@ class UserWebAuthnController extends BaseController
|
||||
["localhost"]
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
return redirect(route("login"));
|
||||
return new Response($e->getMessage(), 500);
|
||||
}
|
||||
Auth::loginUsingId($publicKeyCredentialSource->getUserHandle());
|
||||
return redirect()->intended();
|
||||
return [
|
||||
"success" => true,
|
||||
"code" => 0,
|
||||
"message" => "登录成功",
|
||||
"userId" => $publicKeyCredentialSource->getUserHandle()
|
||||
];
|
||||
}
|
||||
|
||||
private function get_authn_attestation_response_validator(): AuthenticatorAttestationResponseValidator
|
||||
|
Loading…
x
Reference in New Issue
Block a user