Passkeys

Summary

  1. In tests/db-utils.ts, create a new utility createPasskey. It will only be responsible for storing the given passkey correctly in the database (that it belongs to the given user).
  2. Install test-passkey. We will use it to generate test passkeys faster for tests.
  3. Create a new test at tests/e2e/authentication-passkeys.test.ts.
  4. Add a test case for successful auth using passkeys. Navigate to /login first. This is important.
  5. Create a test passkey, create a test user. Use createPasskey to store the generated passkey in the database.
  6. Now, we need to tell Playwright how to handle passkeys. In the test, create the createWebAuthnClient function and go step-by-step.
  7. Use the created createWebAuthnClient function to tell the browser how to react to the passkey input prompt (to use our test passkey).
  8. Continue with the login flow. Verify the auth state.
  9. npm run test:e2e.

  1. Add another test case for the error scenario.
  2. npm run test:e2e.

Please set the playground first

Loading "Passkeys"
Loading "Passkeys"

No tests here 😢 Sorry.