quarkusio/quarkus · error · Error

Login path is missing!

Error message

Login path is missing!

What it means

webauthn.js's login() method requires the WebAuthn object to have a loginPath configured (where the assertion result is POSTed). Missing it throws a synchronous Error before the authentication ceremony starts.

Source

Thrown at extensions/security-webauthn/runtime/src/main/resources/webauthn.js:191

          headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
          },
          body: JSON.stringify(body)
        })
      })
      .then(res => {
        if (res.status >= 200 && res.status < 300) {
          return res;
        }
        throw new Error(res.statusText, {cause: res});
      });
  };

  WebAuthn.prototype.login = function (user) {
    const self = this;
	if (!self.loginPath) {
	  throw new Error('Login path is missing!');
	}
    return self.loginClientSteps(user)
      .then(body => {
        return self.fetchWithCsrf(self.loginPath, {
          method: 'POST',
          headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
          },
          body: JSON.stringify(body),
        })
      })
      .then(res => {
        if (res.status >= 200 && res.status < 300) {
          return res;
        }
        throw new Error(res.statusText, {cause: res});
      });

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set webauthn.loginPath = '/q/webauthn/login' (or your configured endpoint) before calling login()
  2. Ensure the page's server-side template/config injects the login path into the WebAuthn JS object
  3. Add a check in your page code that the path properties are set before wiring event handlers

Example fix

// before
const webauthn = new WebAuthn();
webauthn.login(user);
// after
const webauthn = new WebAuthn();
webauthn.loginPath = '/q/webauthn/login';
webauthn.login(user);
Defensive patterns

Strategy: validation

Validate before calling

if (!webauthn.loginPath) {
  throw new Error('webauthn.loginPath must be set before calling login()');
}
return webauthn.login(user);

Type guard

function canLogin(w) { return typeof w.loginPath === 'string' && w.loginPath.length > 0; }

Try / catch

try {
  webauthn.login(user);
} catch (e) {
  if (e.message.includes('Login path is missing')) {
    webauthn.loginPath = '/q/webauthn/login';
    webauthn.login(user);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling webauthn.login(user) when webauthn.loginPath was never set on the instance (or not provided by the server-generated configuration).

Common situations: Client init code only sets registerPath; server did not expose the login endpoint path to the page; refactored pages where login handling was added without updating the JS bootstrap.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/1af5ae22051b6782. Report an issue: GitHub.