Skip to content

Demo update safari fix #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Demo/Pages/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@


<link href="https://fonts.googleapis.com/css?family=Work+Sans" rel="stylesheet">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sweetalert2"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sweetalert2" defer></script>
<script type="text/javascript" src="~/js/jquery-3.6.0.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous" defer></script>
<!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>-->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.10.1/sweetalert2.min.css" />
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">-->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.min.css" rel="stylesheet" type="text/css" />
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<script src="https://use.fontawesome.com/releases/v5.3.1/js/all.js" defer></script>
<style>
html {
scroll-behavior: smooth;
Expand Down
18 changes: 9 additions & 9 deletions Demo/wwwroot/js/custom.login.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ async function handleSignInSubmit(event) {
// send to server for registering
let makeAssertionOptions;
try {
var res = await fetch('/assertionOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

makeAssertionOptions = await res.json();
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
makeAssertionOptions = await $.post({
url: '/assertionOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
} catch (e) {
showErrorAlert("Request to server failed", e);
}
Expand Down
20 changes: 9 additions & 11 deletions Demo/wwwroot/js/custom.register.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,15 @@ async function handleRegisterSubmit(event) {
}

async function fetchMakeCredentialOptions(formData) {
let response = await fetch('/makeCredentialOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

let data = await response.json();

return data;
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
return await $.post({
url: '/makeCredentialOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
}

// This should be used to verify the auth data with the server
Expand Down
2 changes: 2 additions & 0 deletions Demo/wwwroot/js/jquery-3.6.0.min.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Demo/wwwroot/js/mfa.login.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ async function handleSignInSubmit(event) {
// send to server for registering
let makeAssertionOptions;
try {
var res = await fetch('/assertionOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

makeAssertionOptions = await res.json();
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
makeAssertionOptions = await $.post({
url: '/assertionOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
} catch (e) {
showErrorAlert("Request to server failed", e);
}
Expand Down
20 changes: 9 additions & 11 deletions Demo/wwwroot/js/mfa.register.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,15 @@ async function handleRegisterSubmit(event) {
}

async function fetchMakeCredentialOptions(formData) {
let response = await fetch('/makeCredentialOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

let data = await response.json();

return data;
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
return await $.post({
url: '/makeCredentialOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
}


Expand Down
18 changes: 9 additions & 9 deletions Demo/wwwroot/js/passwordless.login.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ async function handleSignInSubmit(event) {
// send to server for registering
let makeAssertionOptions;
try {
var res = await fetch('/assertionOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

makeAssertionOptions = await res.json();
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
makeAssertionOptions = await $.post({
url: '/assertionOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
} catch (e) {
showErrorAlert("Request to server failed", e);
}
Expand Down
20 changes: 9 additions & 11 deletions Demo/wwwroot/js/passwordless.register.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,15 @@ async function handleRegisterSubmit(event) {
}

async function fetchMakeCredentialOptions(formData) {
let response = await fetch('/makeCredentialOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

let data = await response.json();

return data;
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
return await $.post({
url: '/makeCredentialOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
}


Expand Down
18 changes: 9 additions & 9 deletions Demo/wwwroot/js/usernameless.login.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ async function handleSignInSubmit(event) {
// send to server for registering
let makeAssertionOptions;
try {
var res = await fetch('/assertionOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

makeAssertionOptions = await res.json();
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
makeAssertionOptions = await $.post({
url: '/assertionOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
} catch (e) {
showErrorAlert("Request to server failed", e);
}
Expand Down
20 changes: 9 additions & 11 deletions Demo/wwwroot/js/usernameless.register.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,15 @@ async function handleRegisterSubmit(event) {
}

async function fetchMakeCredentialOptions(formData) {
let response = await fetch('/makeCredentialOptions', {
method: 'POST', // or 'PUT'
body: formData, // data can be `string` or {object}!
headers: {
'Accept': 'application/json'
}
});

let data = await response.json();

return data;
// use jquery ajax instead of fetch because of safari browser and platform authenticator
// https://github.com/passwordless-lib/fido2-net-lib/issues/303
return await $.post({
url: '/makeCredentialOptions',
type: 'POST',
data: formData,
processData: false,
contentType: false,
}, 'json');
}


Expand Down