{"record":{"id":"364170e3b178b4b9","repo":"quarkusio/quarkus","slug":"register-path-is-missing","errorCode":null,"errorMessage":"Register path is missing!","messagePattern":"Register path is missing!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/security-webauthn/runtime/src/main/resources/webauthn.js","lineNumber":164,"sourceCode":"      })\n      .then(res => navigator.credentials.create({publicKey: res}))\n      .then(credential => {\n          return {\n            id: credential.id,\n            rawId: bufferToBase64(credential.rawId),\n            response: {\n              attestationObject: bufferToBase64(credential.response.attestationObject),\n              clientDataJSON: bufferToBase64(credential.response.clientDataJSON)\n            },\n            type: credential.type\n          };\n      });\n  };\n\n  WebAuthn.prototype.register = function (user) {\n    const self = this;\n\tif (!self.registerPath) {\n\t  throw new Error('Register path is missing!');\n\t}\n\tif (!user || !user.username) {\n\t\treturn Promise.reject('User name (user.username) required');\n\t}\n    return self.registerClientSteps(user)\n      .then(body => {\n        return self.fetchWithCsrf(self.registerPath + \"?\" + new URLSearchParams({username: user.username}).toString(), {\n          method: 'POST',\n          headers: {\n            'Accept': 'application/json',\n            'Content-Type': 'application/json'\n          },\n          body: JSON.stringify(body)\n        })\n      })\n      .then(res => {\n        if (res.status >= 200 && res.status < 300) {\n          return res;","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/security-webauthn/runtime/src/main/resources/webauthn.js#L146-L182","documentation":"webauthn.js's register() method requires that the WebAuthn object was configured with a registerPath (where the registration result is POSTed). If it is missing, a synchronous Error is thrown before any credential ceremony begins.","triggerScenarios":"Calling webauthn.register(user) on a WebAuthn instance created without setting webauthn.registerPath (or with the server not sending the register path configuration to the client).","commonSituations":"Copy-pasted client bootstrap code that sets loginPath but not registerPath; server-side WebAuthnSecurity config missing the register endpoint so the JS helper is never initialized with it; calling register() on a page meant only for login.","solutions":["Set webauthn.registerPath = '/q/webauthn/register' (or your configured endpoint) before invoking register()","Ensure the server includes the WebAuthn client configuration (register path) when rendering the page / initializing the JS object","Guard the call: only invoke register() on the registration page and login() on the login page"],"exampleFix":"// before\nconst webauthn = new WebAuthn();\nwebauthn.register(user);\n// after\nconst webauthn = new WebAuthn();\nwebauthn.registerPath = '/q/webauthn/register';\nwebauthn.register(user);","handlingStrategy":"validation","validationCode":"if (!webauthn.registerPath) {\n  throw new Error('webauthn.registerPath must be set before calling register()');\n}\nreturn webauthn.register(user);","typeGuard":"function canRegister(w) { return typeof w.registerPath === 'string' && w.registerPath.length > 0; }","tryCatchPattern":"try {\n  webauthn.register(user);\n} catch (e) {\n  if (e.message.includes('Register path is missing')) {\n    webauthn.registerPath = '/q/webauthn/register';\n    webauthn.register(user);\n  } else throw e;\n}","preventionTips":["Always set registerPath at WebAuthn object creation time","Centralize WebAuthn client initialization in one module","Only call register() from the registration page","Check server-rendered config actually injects the path"],"tags":["webauthn","javascript","configuration","browser"],"backgroundTag":"missing-config-value","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}