How pavantejareddy1/secureauth works
SecureAuth is a passwordless authentication platform. Users register or request an OTP in the React app, verify it through the API, and receive a session; authenticated users can also register and use passkeys. Server-side account state supports OTP expiry, lockout, and single-device sessions. The graph also preserves demo/email/SMS delivery and the separate WebAuthn flow. Edges are based on the excerpts, source-index references, and README; unsampled implementation details are not assumed.
Main entry points: App.jsx Route screens · authController.js OTP and sessions · RegisterPage.jsx Registration and OTP · api.js API client
Components 27
Web client
- Route screens
client/src/App.jsx - Auth state
client/src/context/AuthContext.jsx - Registration and OTP
client/src/pages/RegisterPage.jsx - Login screen
client/src/pages/LoginPage.jsx - Passkey screens
client/src/pages/BiometricPage.jsx - Dashboard
client/src/pages/DashboardPage.jsx - Protected route
client/src/components/auth/ProtectedRoute.jsx - OTP input
client/src/components/auth/OtpInput.jsx - Input validation
client/src/utils/validators.js - UI components
client/src/components/ui - API client
client/src/services/api.js
API routing
- Express app
server/app.js - Auth routes
server/routes/auth.js - WebAuthn routes
server/routes/webauthn.js
Authentication
- OTP and sessions
server/controllers/authController.js - Passkey verification
server/controllers/webauthnController.js - Session middleware
server/middleware/authenticate.js - Session tokens
server/utils/session.js - OTP generation
server/utils/otp.js - User records
server/models/User.js
Code delivery
- Delivery selection
server/services/otpDelivery.js - Demo delivery
server/services/demoService.js - Email delivery
server/services/emailService.js - SMS delivery
server/services/smsService.js
Other components
- User
- MongoDB
- Device authenticator
Connections 40
- User → Route screens: uses
README.md - Route screens → Registration and OTP: routes to
client/src/App.jsx - Route screens → Login screen: routes to
client/src/App.jsx - Route screens → Passkey screens: routes to
client/src/App.jsx - Route screens → Dashboard: routes to
client/src/App.jsx - Route screens → Protected route: guards
client/src/App.jsx - Registration and OTP → OTP input: renders
- Registration and OTP → Input validation: validates with
client/src/pages/RegisterPage.jsx - Login screen → Input validation: validates with
client/src/pages/LoginPage.jsx - Registration and OTP → UI components: renders
client/src/pages/RegisterPage.jsx - Login screen → UI components: renders
client/src/pages/LoginPage.jsx - Registration and OTP → API client: requests
client/src/pages/RegisterPage.jsx - Login screen → API client: requests
client/src/pages/LoginPage.jsx - Passkey screens → API client: requests
client/src/pages/BiometricPage.jsx - Dashboard → Auth state: reads state
client/src/pages/DashboardPage.jsx - Protected route → Auth state: checks state
client/src/components/auth/ProtectedRoute.jsx - Auth state → API client: checks session
client/src/context/AuthContext.jsx - API client → Express app: sends API requests
client/src/services/api.js - Express app → Auth routes: mounts
server/app.js - Express app → WebAuthn routes: mounts
server/app.js - Auth routes → OTP and sessions: dispatches
server/routes/auth.js - WebAuthn routes → Passkey verification: dispatches
server/routes/webauthn.js - Auth routes → Session middleware: protects routes
server/routes/auth.js - WebAuthn routes → Session middleware: protects routes
server/routes/webauthn.js - OTP and sessions → User records: reads and writes
server/controllers/authController.js - OTP and sessions → OTP generation: generates and verifies
server/controllers/authController.js - OTP and sessions → Session tokens: creates session
server/controllers/authController.js - OTP and sessions → Delivery selection: delivers codes
server/controllers/authController.js - Passkey verification → User records: reads and writes
server/controllers/webauthnController.js - Passkey verification → Session tokens: creates session
server/controllers/webauthnController.js - Session middleware → Session tokens: verifies token
server/middleware/authenticate.js - Session middleware → User records: checks active session
server/middleware/authenticate.js - OTP and sessions → MongoDB: persists account state
README.md - Passkey verification → Device authenticator: verifies credentials
README.md - User → Device authenticator: uses passkey
README.md - Delivery selection → Demo delivery: selects demo mode
server/services/otpDelivery.js - Delivery selection → Email delivery: selects email
server/services/otpDelivery.js - Delivery selection → SMS delivery: selects SMS
server/services/otpDelivery.js - Email delivery → User: sends code
- SMS delivery → User: sends code