Skip to content

Revert "feat(auth): passwordless email OTP behind console_auth_redesign"#3185

Merged
ygrishajev merged 1 commit into
mainfrom
revert-3178-feat/auth-passwordless
May 15, 2026
Merged

Revert "feat(auth): passwordless email OTP behind console_auth_redesign"#3185
ygrishajev merged 1 commit into
mainfrom
revert-3178-feat/auth-passwordless

Conversation

@ygrishajev
Copy link
Copy Markdown
Contributor

@ygrishajev ygrishajev commented May 15, 2026

Reverts #3178

Summary by CodeRabbit

Release Notes

  • New Features

    • Added dark theme support to authentication layout.
  • Bug Fixes & Improvements

    • Consolidated authentication flows for improved user experience.
    • Enhanced OAuth/social login integration within the primary authentication interface.
  • Removals

    • Discontinued passwordless email code authentication option. Users should use password-based or social login methods instead.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2026

📝 Walkthrough

Walkthrough

This PR consolidates the authentication UI by moving all login, signup, and forgot-password flows into a single AuthPage component, removing the delegated architecture (AuthPageLegacy, AuthPagePasswordless) and the entire passwordless email-code authentication flow. Session setup is refactored to use direct imports rather than DI injection.

Changes

Auth Page and Flow Consolidation

Layer / File(s) Summary
Unified AuthPage Implementation
src/components/auth/AuthPage/AuthPage.tsx, src/components/auth/AuthPage/AuthPage.spec.tsx
AuthPage now renders all auth UI directly: login, signup, forgot-password tabs, social login, and Turnstile captcha. Two React Query mutations handle sign-in/up (with captcha token) and forgot-password submission. Tests verify tab selection, form flows, error rendering, feature-flag-driven layout switching, and social login redirects.
Session Setup Refactoring
src/pages/api/auth/password-login.ts, src/pages/api/auth/password-signup.ts, src/services/app-di-container/server-di-container.service.ts
Endpoints now import setSession directly from @src/lib/auth0/setSession/setSession instead of receiving it from the DI container. The services container removes the setSession provider and explicitly provides getSession.
Passwordless Email-Code Flow Removal
src/components/auth/AuthPagePasswordless/*, src/pages/api/auth/email-code-{start,verify}.ts, src/services/auth/auth/auth.service.ts, src/services/session/session.service.ts, tests/ui/pages/AuthPagePasswordless.ts, tests/ui/passwordless-login.spec.ts
Deletes EmailCodeStart/EmailCodeVerify components, /login-v2 page, email-code API endpoints, and related test suites. Removes startEmailCode/verifyEmailCode methods from AuthService and SessionService. Updates sendPasswordResetEmail to compute retryAfter inline from headers instead of using a helper function.
Styling and Email Verification Updates
src/components/auth/AuthLayoutV2/AuthLayoutV2.tsx, tests/ui/services/email-verification/mailsac-code.strategy.ts
AuthLayoutV2 dark-mode background applied. Email OTP extraction now uses subject-based message selection and a generic 6-digit regex instead of context-dependent keyword matching.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The consolidation is substantial and cross-cutting: it removes multiple components and API routes, refactors the main auth entry point into a unified implementation, and updates DI wiring. The logic density in the new AuthPage implementation is high (mutations, captcha handling, tab management), and comprehensive test coverage must be verified for all paths. The passwordless flow removal is straightforward deletion but requires confirming no orphaned imports or references remain.

Possibly related PRs

  • akash-network/console#3178: Earlier PR that introduced the console_auth_redesign flag and laid groundwork for consolidating auth pages; this PR completes the migration by removing the legacy/passwordless paths entirely.

Suggested labels

size: XL, experienced-contributor

Suggested reviewers

  • stalniy
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-3178-feat/auth-passwordless

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.28%. Comparing base (c73a6b0) to head (7f9f80e).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ploy-web/src/components/auth/AuthPage/AuthPage.tsx 96.49% 2 Missing ⚠️
...ps/deploy-web/src/pages/api/auth/password-login.ts 0.00% 1 Missing ⚠️
...s/deploy-web/src/pages/api/auth/password-signup.ts 0.00% 1 Missing ⚠️
...deploy-web/src/services/session/session.service.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3185      +/-   ##
==========================================
- Coverage   63.95%   62.28%   -1.67%     
==========================================
  Files        1098     1009      -89     
  Lines       26650    24555    -2095     
  Branches     6454     6037     -417     
==========================================
- Hits        17043    15295    -1748     
+ Misses       8410     8091     -319     
+ Partials     1197     1169      -28     
Flag Coverage Δ *Carryforward flag
api 84.29% <ø> (ø) Carriedforward from c73a6b0
deploy-web 46.68% <91.66%> (-0.71%) ⬇️
log-collector ?
notifications 91.06% <ø> (ø) Carriedforward from c73a6b0
provider-console 81.48% <ø> (ø) Carriedforward from c73a6b0
provider-inventory ?
provider-proxy 86.08% <ø> (ø) Carriedforward from c73a6b0
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
.../src/components/auth/AuthLayoutV2/AuthLayoutV2.tsx 83.33% <ø> (ø)
...es/app-di-container/server-di-container.service.ts 100.00% <ø> (ø)
.../deploy-web/src/services/auth/auth/auth.service.ts 70.00% <ø> (-5.00%) ⬇️
...ps/deploy-web/src/pages/api/auth/password-login.ts 0.00% <0.00%> (ø)
...s/deploy-web/src/pages/api/auth/password-signup.ts 0.00% <0.00%> (ø)
...deploy-web/src/services/session/session.service.ts 78.12% <0.00%> (-8.48%) ⬇️
...ploy-web/src/components/auth/AuthPage/AuthPage.tsx 96.72% <96.49%> (-3.28%) ⬇️

... and 80 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ygrishajev ygrishajev enabled auto-merge May 15, 2026 15:51
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/deploy-web/src/components/auth/AuthPage/AuthPage.tsx`:
- Around line 97-106: The useCallback for setActiveView closes over
resetMutations but resetMutations is not included in the dependency array,
causing a stale closure; update the dependency array for useCallback to include
resetMutations (i.e., change [searchParams, router] to [searchParams, router,
resetMutations]) so setActiveView always uses the latest resetMutations
implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d8654a61-5f84-4c03-b0d6-ddc67aaa3e47

📥 Commits

Reviewing files that changed from the base of the PR and between c73a6b0 and 7f9f80e.

📒 Files selected for processing (31)
  • .husky/commit-msg
  • apps/deploy-web/src/components/auth/AuthLayoutV2/AuthLayoutV2.tsx
  • apps/deploy-web/src/components/auth/AuthPage/AuthPage.spec.tsx
  • apps/deploy-web/src/components/auth/AuthPage/AuthPage.tsx
  • apps/deploy-web/src/components/auth/AuthPageLegacy/AuthPageLegacy.spec.tsx
  • apps/deploy-web/src/components/auth/AuthPageLegacy/AuthPageLegacy.tsx
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/AuthPagePasswordless.spec.tsx
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/AuthPagePasswordless.tsx
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/withPersistedPasswordlessFlow.spec.tsx
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/withPersistedPasswordlessFlow.tsx
  • apps/deploy-web/src/components/auth/EmailCodeStart/EmailCodeStart.spec.tsx
  • apps/deploy-web/src/components/auth/EmailCodeStart/EmailCodeStart.tsx
  • apps/deploy-web/src/components/auth/EmailCodeVerify/EmailCodeVerify.spec.tsx
  • apps/deploy-web/src/components/auth/EmailCodeVerify/EmailCodeVerify.tsx
  • apps/deploy-web/src/components/auth/OAuthRow/OAuthRow.spec.tsx
  • apps/deploy-web/src/components/auth/OAuthRow/OAuthRow.tsx
  • apps/deploy-web/src/pages/api/auth/email-code-start.spec.ts
  • apps/deploy-web/src/pages/api/auth/email-code-start.ts
  • apps/deploy-web/src/pages/api/auth/email-code-verify.spec.ts
  • apps/deploy-web/src/pages/api/auth/email-code-verify.ts
  • apps/deploy-web/src/pages/api/auth/password-login.ts
  • apps/deploy-web/src/pages/api/auth/password-signup.ts
  • apps/deploy-web/src/pages/login-v2/index.tsx
  • apps/deploy-web/src/services/app-di-container/server-di-container.service.ts
  • apps/deploy-web/src/services/auth/auth/auth.service.spec.ts
  • apps/deploy-web/src/services/auth/auth/auth.service.ts
  • apps/deploy-web/src/services/session/session.service.spec.ts
  • apps/deploy-web/src/services/session/session.service.ts
  • apps/deploy-web/tests/ui/pages/AuthPagePasswordless.ts
  • apps/deploy-web/tests/ui/passwordless-login.spec.ts
  • apps/deploy-web/tests/ui/services/email-verification/mailsac-code.strategy.ts
💤 Files with no reviewable changes (23)
  • apps/deploy-web/src/components/auth/OAuthRow/OAuthRow.spec.tsx
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/AuthPagePasswordless.tsx
  • apps/deploy-web/src/pages/api/auth/email-code-start.spec.ts
  • apps/deploy-web/tests/ui/passwordless-login.spec.ts
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/withPersistedPasswordlessFlow.spec.tsx
  • apps/deploy-web/tests/ui/pages/AuthPagePasswordless.ts
  • apps/deploy-web/src/pages/api/auth/email-code-verify.ts
  • apps/deploy-web/src/pages/api/auth/email-code-verify.spec.ts
  • apps/deploy-web/src/pages/login-v2/index.tsx
  • apps/deploy-web/src/components/auth/OAuthRow/OAuthRow.tsx
  • apps/deploy-web/src/components/auth/EmailCodeStart/EmailCodeStart.spec.tsx
  • apps/deploy-web/src/pages/api/auth/email-code-start.ts
  • apps/deploy-web/src/components/auth/EmailCodeStart/EmailCodeStart.tsx
  • apps/deploy-web/src/components/auth/AuthPageLegacy/AuthPageLegacy.spec.tsx
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/AuthPagePasswordless.spec.tsx
  • apps/deploy-web/src/components/auth/AuthPagePasswordless/withPersistedPasswordlessFlow.tsx
  • apps/deploy-web/src/components/auth/EmailCodeVerify/EmailCodeVerify.tsx
  • apps/deploy-web/src/components/auth/EmailCodeVerify/EmailCodeVerify.spec.tsx
  • apps/deploy-web/src/services/auth/auth/auth.service.ts
  • apps/deploy-web/src/components/auth/AuthPageLegacy/AuthPageLegacy.tsx
  • apps/deploy-web/src/services/session/session.service.spec.ts
  • apps/deploy-web/src/services/auth/auth/auth.service.spec.ts
  • apps/deploy-web/src/services/app-di-container/server-di-container.service.ts

Comment thread apps/deploy-web/src/components/auth/AuthPage/AuthPage.tsx
@ygrishajev ygrishajev added this pull request to the merge queue May 15, 2026
Merged via the queue into main with commit e1d2bba May 15, 2026
56 checks passed
@ygrishajev ygrishajev deleted the revert-3178-feat/auth-passwordless branch May 15, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants