feat: WebAuthn passkey authentication with IP-conditional remote login - #79
Open
mahdiwafy wants to merge 3 commits into
Open
feat: WebAuthn passkey authentication with IP-conditional remote login#79mahdiwafy wants to merge 3 commits into
mahdiwafy wants to merge 3 commits into
Conversation
- New passkeys table & migration v5 (credential ID, publicKey, counter, etc.) - WebAuthn ceremony API routes: register start/finish, login start/finish, manage - IP detection via isLocalRequest: remoteAuthMode controls login options remotely - Login page: passkey button when passkeys are available - Masuk page: same passkey support in Indonesian locale - Profile page: full passkey management (register, list, delete, remote mode selector) - Uses @simplewebauthn/server + @simplewebauthn/browser v13
… rebuild on CI failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add WebAuthn passkey authentication support. Users can now register biometric (Touch ID, Face ID, Windows Hello) or security key passkeys for passwordless login, managed per-device via Google Password Manager, Apple iCloud Keychain, or any FIDO2-compatible credential manager.
What's Included
Database
passkeystable in local SQLite schema (migration v5)Backend — WebAuthn Ceremony API Routes
POST /api/auth/passkey/register/start— generate registration challenge (auth required)POST /api/auth/passkey/register/finish— verify registration response, store credentialPOST /api/auth/passkey/login/start— generate authentication challenge (public)POST /api/auth/passkey/login/finish— verify assertion, issue JWT session cookieGET|DELETE /api/auth/passkey/manage— list and delete registered passkeysIP Detection + Conditional Auth
remoteAuthMode:"password"(default),"passkey", or"both"isLocalRequest()system — localhost always has full accessremoteAuthMode:"password": traditional password form (default, backward compatible)"passkey": passkey-only login (password form hidden for remote users)"both": both passkey button and password form shownpasskeysEnabledauto-flips totruewhen the first passkey is registeredUI Changes
/login): New "Sign in with Passkey" button when passkeys are available/masuk): Same passkey support in Indonesian locale/dashboard/profile): Full passkey management sectionSettings
passkeysEnabled— auto-managed, set totruewhen first passkey registeredremoteAuthMode— controls remote login method availabilityArchitecture
@simplewebauthn/server(v13) for server-side WebAuthn verification@simplewebauthn/browser(v13) for client-side credential creation/assertionpasskey: trueto track login methodUsage
Testing