Skip to content

Comments

fix: error when I want setup my totp code#599

Merged
NathaelB merged 4 commits intomainfrom
596-error-when-i-want-setup-my-totp-code
Dec 15, 2025
Merged

fix: error when I want setup my totp code#599
NathaelB merged 4 commits intomainfrom
596-error-when-i-want-setup-my-totp-code

Conversation

@NathaelB
Copy link
Member

This pull request introduces several improvements and fixes across the backend authentication logic, TOTP verification, and frontend user experience, particularly around OTP flows. The changes enhance error handling, add support for temporary JWT tokens, improve logging, and refine the frontend OTP and login experience.

Backend: Authentication and JWT Improvements

  • Added support for a new Temporary JWT claim type, including a constructor for temporary tokens with a 5-minute expiry.
  • Improved error handling and logging in authentication services, especially for token verification and session retrieval. Now logs errors with details for easier debugging and returns more appropriate error types.

Backend: TOTP Verification Enhancements

  • Improved TOTP code verification logic: replaced a for-loop with a more robust and readable array-based approach, and added detailed error logging when verification fails.
  • Enhanced error messages when parsing or verifying TOTP codes, making troubleshooting easier.

DevOps: Docker Compose Configuration

  • Updated docker-compose.yaml to use consistent ports (3333 for API and 5555 for webapp) and matching environment variables, ensuring local development matches expected endpoints.

Frontend: OTP and Authentication UX Improvements

  • Improved OTP setup and challenge flows by adding user-facing error toasts and redirect logic when tokens are missing or invalid.
  • Added loading states and spinners to OTP challenge UI for better feedback during sign-in.
  • Adjusted login page to hide unused social login elements for a cleaner UI.
  • Improved token state management in the required action page to avoid unnecessary state updates and show a loading indicator when appropriate.

Frontend: Query Behavior

  • Disabled automatic refetching of queries on window focus to prevent unnecessary network requests.

Add refetchOnWindowFocus: false to react-query config. Show toast and
redirect when OTP setup token is missing and log/setup errors. Show
toast on OTP challenge errors, pass isLoading and display a
spinner/Signing In... state during OTP submission. Prevent repeated
auth-token setting in required-action and render a loading fallback.
Hide social login and extra links on the login page.
@NathaelB NathaelB added this to the v0.2.0 milestone Dec 15, 2025
@NathaelB NathaelB self-assigned this Dec 15, 2025
@NathaelB NathaelB linked an issue Dec 15, 2025 that may be closed by this pull request
@LeadcodeDev LeadcodeDev self-requested a review December 15, 2025 14:31
@NathaelB NathaelB merged commit 0d3d48d into main Dec 15, 2025
8 checks passed
@NathaelB NathaelB deleted the 596-error-when-i-want-setup-my-totp-code branch December 15, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

error when I want setup my TOTP code

2 participants