Skip to content

Commit 523735f

Browse files
authored
Update WebAuthn method calls to use object parameters (#687)
Refactored `startAuthentication` and `startRegistration` calls to use object syntax for passing parameters. This improves code clarity and aligns with expected API usage patterns.
1 parent 90ef21b commit 523735f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/stimulus/assets/dist/controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class default_1 extends Controller {
3939
}
4040
async _processSignin(optionsResponseJson, useBrowserAutofill) {
4141
try {
42-
const authenticatorResponse = await startAuthentication(optionsResponseJson, useBrowserAutofill);
42+
const authenticatorResponse = await startAuthentication({ optionsJSON: optionsResponseJson, useBrowserAutofill });
4343
this._dispatchEvent('webauthn:authenticator:response', { response: authenticatorResponse });
4444
const assertionResponse = await this._getAssertionResponse(authenticatorResponse);
4545
if (assertionResponse !== false && this.requestSuccessRedirectUriValue) {
@@ -62,7 +62,7 @@ class default_1 extends Controller {
6262
if (!optionsResponseJson) {
6363
return;
6464
}
65-
const authenticatorResponse = await startRegistration(optionsResponseJson);
65+
const authenticatorResponse = await startRegistration({ optionsJSON: optionsResponseJson });
6666
this._dispatchEvent('webauthn:authenticator:response', { response: authenticatorResponse });
6767
const attestationResponseJSON = await this._getAttestationResponse(authenticatorResponse);
6868
if (attestationResponseJSON !== false && this.creationSuccessRedirectUriValue) {

src/stimulus/assets/src/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default class extends Controller {
8383
private async _processSignin(optionsResponseJson: Object, useBrowserAutofill: boolean): Promise<void> {
8484
try {
8585
// @ts-ignore
86-
const authenticatorResponse = await startAuthentication(optionsResponseJson, useBrowserAutofill);
86+
const authenticatorResponse = await startAuthentication({ optionsJSON: optionsResponseJson, useBrowserAutofill });
8787
this._dispatchEvent('webauthn:authenticator:response', { response: authenticatorResponse });
8888

8989
const assertionResponse = await this._getAssertionResponse(authenticatorResponse);
@@ -109,7 +109,7 @@ export default class extends Controller {
109109
}
110110

111111
// @ts-ignore
112-
const authenticatorResponse = await startRegistration(optionsResponseJson);
112+
const authenticatorResponse = await startRegistration({ optionsJSON: optionsResponseJson });
113113
this._dispatchEvent('webauthn:authenticator:response', { response: authenticatorResponse });
114114

115115
const attestationResponseJSON = await this._getAttestationResponse(authenticatorResponse);

0 commit comments

Comments
 (0)