Closed softalpaca closed 3 years ago
solved it myself. You can add this to your html:
< form id="csrf-token" name="login" method="get"> < input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/> < /form>
and in the webauthn.js:
const postNewAssertionToServer = async (credentialDataForServer) => { const form = document.querySelector('#csrf-token'); const formData = new FormData(form); Object.entries(credentialDataForServer).forEach(([key, value]) => { formData.set(key, value); });
return await fetch_json( "/verify_credential_info", { method: "POST", body: formData });
}
Hello, when verifying the registration I get this error that the CSRF token is missing. The console is printing:
and the response body for "verify_credential_info" is showing:
How and where can I add the csrf_token so that it is recognized as such? I would be super grateful for any help!