mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-15 09:20:12 +00:00
refactor: update options API for simplewebauthn (#543)
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
// Get access token if not signed in
|
// Get access token if not signed in
|
||||||
if (!$userStore?.id) {
|
if (!$userStore?.id) {
|
||||||
const loginOptions = await webauthnService.getLoginOptions();
|
const loginOptions = await webauthnService.getLoginOptions();
|
||||||
const authResponse = await startAuthentication(loginOptions);
|
const authResponse = await startAuthentication({optionsJSON: loginOptions});
|
||||||
const user = await webauthnService.finishLogin(authResponse);
|
const user = await webauthnService.finishLogin(authResponse);
|
||||||
userStore.setUser(user);
|
userStore.setUser(user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
// Get access token if not signed in
|
// Get access token if not signed in
|
||||||
if (!$userStore) {
|
if (!$userStore) {
|
||||||
const loginOptions = await webauthnService.getLoginOptions();
|
const loginOptions = await webauthnService.getLoginOptions();
|
||||||
const authResponse = await startAuthentication(loginOptions);
|
const authResponse = await startAuthentication({optionsJSON: loginOptions});
|
||||||
const user = await webauthnService.finishLogin(authResponse);
|
const user = await webauthnService.finishLogin(authResponse);
|
||||||
userStore.setUser(user);
|
userStore.setUser(user);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
isLoading = true;
|
isLoading = true;
|
||||||
try {
|
try {
|
||||||
const loginOptions = await webauthnService.getLoginOptions();
|
const loginOptions = await webauthnService.getLoginOptions();
|
||||||
const authResponse = await startAuthentication(loginOptions);
|
const authResponse = await startAuthentication({optionsJSON: loginOptions});
|
||||||
const user = await webauthnService.finishLogin(authResponse);
|
const user = await webauthnService.finishLogin(authResponse);
|
||||||
|
|
||||||
userStore.setUser(user);
|
userStore.setUser(user);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
async function createPasskey() {
|
async function createPasskey() {
|
||||||
try {
|
try {
|
||||||
const opts = await webauthnService.getRegistrationOptions();
|
const opts = await webauthnService.getRegistrationOptions();
|
||||||
const attResp = await startRegistration(opts);
|
const attResp = await startRegistration({optionsJSON: opts});
|
||||||
const passkey = await webauthnService.finishRegistration(attResp);
|
const passkey = await webauthnService.finishRegistration(attResp);
|
||||||
|
|
||||||
passkeys = await webauthnService.listCredentials();
|
passkeys = await webauthnService.listCredentials();
|
||||||
|
|||||||
Reference in New Issue
Block a user