Skip to content

feat: add admin MFA UI - #15493

Merged
christiananese merged 7 commits into
developfrom
feat/auth-mfa-admin-ui
May 26, 2026
Merged

feat: add admin MFA UI#15493
christiananese merged 7 commits into
developfrom
feat/auth-mfa-admin-ui

Conversation

@christiananese

@christiananese christiananese commented May 25, 2026

Copy link
Copy Markdown
Contributor

Adds admin MFA setup and challenge handling in the dashboard.

Bildschirmaufnahme.2026-05-25.um.09.15.45.mov

@changeset-bot

changeset-bot Bot commented May 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7f821b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 78 packages
Name Type
@medusajs/utils Patch
create-medusa-app Patch
@medusajs/event-bus-redis Patch
@medusajs/framework Patch
@medusajs/modules-sdk Patch
@medusajs/orchestration Patch
@medusajs/workflows-sdk Patch
@medusajs/cli Patch
@medusajs/medusa-oas-cli Patch
@medusajs/medusa Patch
@medusajs/test-utils Patch
@medusajs/analytics Patch
@medusajs/api-key Patch
@medusajs/auth Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/caching Patch
@medusajs/cart Patch
@medusajs/currency Patch
@medusajs/customer Patch
@medusajs/event-bus-local Patch
@medusajs/file Patch
@medusajs/fulfillment Patch
@medusajs/index Patch
@medusajs/inventory Patch
@medusajs/link-modules Patch
@medusajs/locking Patch
@medusajs/notification Patch
@medusajs/order Patch
@medusajs/payment Patch
@medusajs/pricing Patch
@medusajs/product Patch
@medusajs/promotion Patch
@medusajs/rbac Patch
@medusajs/region Patch
@medusajs/sales-channel Patch
@medusajs/settings Patch
@medusajs/stock-location Patch
@medusajs/store Patch
@medusajs/tax Patch
@medusajs/translation Patch
@medusajs/user Patch
@medusajs/workflow-engine-inmemory Patch
@medusajs/workflow-engine-redis Patch
@medusajs/analytics-local Patch
@medusajs/analytics-posthog Patch
@medusajs/auth-emailpass Patch
@medusajs/auth-github Patch
@medusajs/auth-google Patch
@medusajs/caching-redis Patch
@medusajs/file-local Patch
@medusajs/file-s3 Patch
@medusajs/fulfillment-manual Patch
@medusajs/locking-postgres Patch
@medusajs/locking-redis Patch
@medusajs/notification-local Patch
@medusajs/notification-sendgrid Patch
@medusajs/payment-stripe Patch
@medusajs/draft-order Patch
@medusajs/loyalty-plugin Patch
@medusajs/core-flows Patch
integration-tests-http Patch
@medusajs/oas-github-ci Patch
@medusajs/js-sdk Patch
@medusajs/types Patch
@medusajs/http-types-generator Patch
@medusajs/deps Patch
@medusajs/telemetry Patch
@medusajs/admin-bundler Patch
@medusajs/admin-sdk Patch
@medusajs/admin-shared Patch
@medusajs/admin-vite-plugin Patch
@medusajs/dashboard Patch
@medusajs/icons Patch
@medusajs/toolbox Patch
@medusajs/ui-preset Patch
medusa-dev-cli Patch
@medusajs/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@christiananese
christiananese force-pushed the feat/auth-mfa-admin-ui branch from ef89a6d to 39bc38f Compare May 25, 2026 08:14
@christiananese
christiananese marked this pull request as ready for review May 25, 2026 08:21
@christiananese
christiananese requested a review from a team as a code owner May 25, 2026 08:21
Comment thread packages/admin/dashboard/src/routes/login/components/mfa-challenge-form.tsx Outdated
Comment on lines +161 to +163
<Button variant="secondary" onClick={onClose}>
{t("actions.cancel")}
</Button>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestion: for the recovery codes screen, the cancel button is unnecessary here. I'm also not a big fan of showing the Download / Copy above the Cancel / Complete

Maybe we can either:

  1. Use the CodeBlock component for the recovery codes, with the built-in copy button, and show in the footer "Download" and "Complete"
  2. Show "Download" / "Copy" / "Complete" in the footer

<>
<ShieldCheck className="text-ui-fg-subtle" />
<Text size="small" leading="compact">
{enabledFactorLabel || t("profile.mfa.authenticatorApp")}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: not sure what enabledFactorLabel would be, but is it something that we can allow translating?


if (isLoading || !user) {
return <SingleColumnPageSkeleton sections={1} />
return <SingleColumnPageSkeleton sections={3} />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't it be 2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I used 3 before

Comment thread packages/admin/dashboard/src/hooks/api/mfa.tsx Outdated
export const callbackWithCloudAuth = async (
query: Record<string, unknown>
): ReturnType<typeof sdk.auth.callback> =>
sdk.auth.callback("user", "cloud", query)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume this works just fine when doing auth with Cloud? How does it work, does it require MFA after the oauth or it's skipped entirely?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cloud OAuth can return an MFA challenge after the OAuth callback. Admin then shows the same MFA challenge screen and only continues after challenge verification. So admin MFA is not skipped

@sradevski sradevski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good overall 👍 We just need to test it well before releasing a new core version

@christiananese

Copy link
Copy Markdown
Contributor Author

/snapshot-this

@github-actions

Copy link
Copy Markdown
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/admin-bundler@2.15.5-snapshot-20260526085619
yarn add @medusajs/admin-sdk@2.15.5-snapshot-20260526085619
yarn add @medusajs/admin-shared@2.15.5-snapshot-20260526085619
yarn add @medusajs/admin-vite-plugin@2.15.5-snapshot-20260526085619
yarn add @medusajs/dashboard@2.15.5-snapshot-20260526085619
yarn add create-medusa-app@2.15.5-snapshot-20260526085619
yarn add @medusajs/http-types-generator@2.15.5-snapshot-20260526085619
yarn add @medusajs/cli@2.15.5-snapshot-20260526085619
yarn add medusa-dev-cli@2.15.5-snapshot-20260526085619
yarn add @medusajs/medusa-oas-cli@2.15.5-snapshot-20260526085619
yarn add @medusajs/core-flows@2.15.5-snapshot-20260526085619
yarn add @medusajs/framework@2.15.5-snapshot-20260526085619
yarn add @medusajs/js-sdk@2.15.5-snapshot-20260526085619
yarn add @medusajs/modules-sdk@2.15.5-snapshot-20260526085619
yarn add @medusajs/orchestration@2.15.5-snapshot-20260526085619
yarn add @medusajs/types@2.15.5-snapshot-20260526085619
yarn add @medusajs/utils@2.15.5-snapshot-20260526085619
yarn add @medusajs/workflows-sdk@2.15.5-snapshot-20260526085619
yarn add @medusajs/deps@2.15.5-snapshot-20260526085619
yarn add @medusajs/icons@2.15.5-snapshot-20260526085619
yarn add @medusajs/ui@4.1.15-snapshot-20260526085619
yarn add @medusajs/ui-preset@2.15.5-snapshot-20260526085619
yarn add @medusajs/medusa@2.15.5-snapshot-20260526085619
yarn add @medusajs/telemetry@2.15.5-snapshot-20260526085619
yarn add @medusajs/test-utils@2.15.5-snapshot-20260526085619
yarn add @medusajs/analytics@2.15.5-snapshot-20260526085619
yarn add @medusajs/api-key@2.15.5-snapshot-20260526085619
yarn add @medusajs/auth@2.15.5-snapshot-20260526085619
yarn add @medusajs/cache-inmemory@2.15.5-snapshot-20260526085619
yarn add @medusajs/cache-redis@2.15.5-snapshot-20260526085619
yarn add @medusajs/caching@2.15.5-snapshot-20260526085619
yarn add @medusajs/cart@2.15.5-snapshot-20260526085619
yarn add @medusajs/currency@2.15.5-snapshot-20260526085619
yarn add @medusajs/customer@2.15.5-snapshot-20260526085619
yarn add @medusajs/event-bus-local@2.15.5-snapshot-20260526085619
yarn add @medusajs/event-bus-redis@2.15.5-snapshot-20260526085619
yarn add @medusajs/file@2.15.5-snapshot-20260526085619
yarn add @medusajs/fulfillment@2.15.5-snapshot-20260526085619
yarn add @medusajs/index@2.15.5-snapshot-20260526085619
yarn add @medusajs/inventory@2.15.5-snapshot-20260526085619
yarn add @medusajs/link-modules@2.15.5-snapshot-20260526085619
yarn add @medusajs/locking@2.15.5-snapshot-20260526085619
yarn add @medusajs/notification@2.15.5-snapshot-20260526085619
yarn add @medusajs/order@2.15.5-snapshot-20260526085619
yarn add @medusajs/payment@2.15.5-snapshot-20260526085619
yarn add @medusajs/pricing@2.15.5-snapshot-20260526085619
yarn add @medusajs/product@2.15.5-snapshot-20260526085619
yarn add @medusajs/promotion@2.15.5-snapshot-20260526085619
yarn add @medusajs/analytics-local@2.15.5-snapshot-20260526085619
yarn add @medusajs/analytics-posthog@2.15.5-snapshot-20260526085619
yarn add @medusajs/auth-emailpass@2.15.5-snapshot-20260526085619
yarn add @medusajs/auth-github@2.15.5-snapshot-20260526085619
yarn add @medusajs/auth-google@2.15.5-snapshot-20260526085619
yarn add @medusajs/caching-redis@2.15.5-snapshot-20260526085619
yarn add @medusajs/file-local@2.15.5-snapshot-20260526085619
yarn add @medusajs/file-s3@2.15.5-snapshot-20260526085619
yarn add @medusajs/fulfillment-manual@2.15.5-snapshot-20260526085619
yarn add @medusajs/locking-postgres@2.15.5-snapshot-20260526085619
yarn add @medusajs/locking-redis@2.15.5-snapshot-20260526085619
yarn add @medusajs/notification-local@2.15.5-snapshot-20260526085619
yarn add @medusajs/notification-sendgrid@2.15.5-snapshot-20260526085619
yarn add @medusajs/payment-stripe@2.15.5-snapshot-20260526085619
yarn add @medusajs/rbac@2.15.5-snapshot-20260526085619
yarn add @medusajs/region@2.15.5-snapshot-20260526085619
yarn add @medusajs/sales-channel@2.15.5-snapshot-20260526085619
yarn add @medusajs/settings@2.15.5-snapshot-20260526085619
yarn add @medusajs/stock-location@2.15.5-snapshot-20260526085619
yarn add @medusajs/store@2.15.5-snapshot-20260526085619
yarn add @medusajs/tax@2.15.5-snapshot-20260526085619
yarn add @medusajs/translation@2.15.5-snapshot-20260526085619
yarn add @medusajs/user@2.15.5-snapshot-20260526085619
yarn add @medusajs/workflow-engine-inmemory@2.15.5-snapshot-20260526085619
yarn add @medusajs/workflow-engine-redis@2.15.5-snapshot-20260526085619
yarn add @medusajs/draft-order@2.15.5-snapshot-20260526085619
yarn add @medusajs/loyalty-plugin@2.15.5-snapshot-20260526085619

Latest commit: c2fb742

@christiananese
christiananese force-pushed the feat/auth-mfa-admin-ui branch from 9ecf8ce to 7f821b3 Compare May 26, 2026 11:47
@christiananese

Copy link
Copy Markdown
Contributor Author

/snapshot-this

NicolasGorga pushed a commit that referenced this pull request May 27, 2026
* Add admin MFA UI

* Refine admin MFA setup modal

* Await admin MFA success callback

* Remove dashboard dev proxy config

* Refine MFA admin review feedback

* Harden MFA admin error handling

* fix(admin): prepare new apps for mfa
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.

3 participants