|
178 | 178 | await nextTick(); |
179 | 179 | await isCMAAvailable(); |
180 | 180 | tagOtpInputs(); |
181 | | - console.log("Checking if device supports passkeys:", isPasskeysSupported.value); |
182 | 181 | if (isPasskeysSupported.value === true) { |
183 | | - console.log("Device supports passkeys, checking if user has passkeys..."); |
184 | 182 | await checkIfUserHasPasskeys(); |
185 | | - console.log("Does user have passkeys:", doesUserHavePasskeys.value); |
186 | 183 | } |
187 | 184 | document.addEventListener('focusin', handleGlobalFocusIn, true); |
188 | 185 | focusFirstAvailableOtpInput(); |
|
225 | 222 | async function sendCode (value: any, factorMode: 'TOTP' | 'passkey', passkeyOptions: any) { |
226 | 223 | inProgress.value = true; |
227 | 224 | const usePasskey = factorMode === 'passkey'; |
228 | | - console.log("Sending code with factorMode:", factorMode); |
229 | | - console.log("Passkey options:", passkeyOptions); |
230 | 225 | const resp = await callAdminForthApi({ |
231 | 226 | method: 'POST', |
232 | 227 | path: '/plugin/twofa/confirmLogin', |
|
237 | 232 | secret: null, |
238 | 233 | } |
239 | 234 | }) |
240 | | - console.log("Response from confirmLogin:", resp); |
241 | 235 | if ( resp.allowedLogin ) { |
242 | 236 | if ( route.meta.isPasskeysEnabled && !doesUserHavePasskeys.value ) { |
243 | 237 | handlePasskeyAlert(route.meta.suggestionPeriod, router); |
244 | 238 | } |
245 | | - console.log("Login confirmed, finishing login..."); |
246 | 239 | await user.finishLogin(); |
247 | 240 | } else { |
248 | | - console.log("Login not allowed, showing error:", resp.error); |
249 | 241 | if (usePasskey) { |
250 | 242 | showErrorTost(t(resp.error)); |
251 | 243 | codeError.value = resp.error || t('Passkey authentication failed'); |
|
324 | 316 |
|
325 | 317 | async function createSignInRequest() { |
326 | 318 | let response; |
327 | | - console.log("Creating sign-in request for passkey..."); |
328 | 319 | try { |
329 | 320 | response = await callAdminForthApi({ |
330 | 321 | path: `/plugin/passkeys/signInRequest`, |
331 | 322 | method: 'POST', |
332 | 323 | }); |
333 | 324 | } catch (error) { |
334 | | - console.log("Error creating sign-in request:", error); |
335 | 325 | console.error('Error creating sign-in request:', error); |
336 | 326 | return; |
337 | 327 | } |
338 | | - console.log("Sign-in request response:", response); |
339 | 328 | if (response.ok === true) { |
340 | 329 | return { _options: response.data, challengeId: response.challengeId }; |
341 | 330 | } else { |
|
347 | 336 | let controller = new AbortController(); |
348 | 337 |
|
349 | 338 | async function authenticate(options) { |
350 | | - console.log("Authenticating with options:", options); |
351 | 339 | controller.abort(); |
352 | 340 | try { |
353 | 341 | // Guard: prevent concurrent navigator.credentials.get calls |
|
365 | 353 | signal: abortController.signal, |
366 | 354 | // mediation can be set if using conditional UI, omitted here intentionally |
367 | 355 | }); |
368 | | - console.log("Credential obtained:", credential); |
369 | 356 | return credential; |
370 | 357 | } catch (error) { |
371 | 358 | console.error('Error during authentication:', error); |
|
0 commit comments