René's URL Explorer Experiment


Title: feat(webapp): add MFA_REQUIRED env flag to enforce MFA for all dashboard users by MauryaQbit · Pull Request #5034 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: feat(webapp): add MFA_REQUIRED env flag to enforce MFA for all dashboard users by MauryaQbit · Pull Request #5034 · triggerdotdev/trigger.dev

X Title: feat(webapp): add MFA_REQUIRED env flag to enforce MFA for all dashboard users by MauryaQbit · Pull Request #5034 · triggerdotdev/trigger.dev

Description: Closes #5025 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Testing Automated apps/webapp/test/mfaRequirement.test.ts — 14 unit tests, all passing. Covers the exempt-path list (including that prefixes of exempt paths are not exempt), the redirect and redirectTo propagation, sanitization of non-navigable targets, the flag-off path, the logged-out path, and throwIfMfaRequired. pnpm run typecheck --filter webapp — 20/20 tasks pass. pnpm run format (oxfmt) — clean. pnpm run lint (oxlint) — exit 0. pnpm run knip — exit 0. Manual Not done. My environment has no working container runtime (Could not find a working container runtime strategy), so I could not boot Postgres/Redis to drive the dashboard end to end, and the testcontainers-backed suites could not run locally either. Those will run in CI. Changelog Adds an opt-in MFA_REQUIRED webapp env var (default false) so self-hosted instances can require multi-factor authentication for every dashboard user. Behaviour with the flag unset is unchanged — every check early-returns on a single boolean read. Flag — MFA_REQUIRED: BoolEnv.default(false) in env.server.ts, alongside the other auth flags. Enforcement — layered, because there is no single guard for all authenticated routes today: requireUser (services/session.server.ts) covers /account/*, /invites, /admin/* and every other requireUser caller, including the _app layout. The root.tsx loader covers routes that authenticate with requireUserId only (which stays cookie-only and has no user row to inspect). The root loader does not run for action-only resource routes, so those actions check separately. Both call the same helper (services/mfa/mfaRequirement.server.ts), which no-ops unless the flag is on and the user is missing MFA. The auth flow (/login*, /magic, /auth/*), /logout, and the enrollment endpoint are exempt so the flow cannot deadlock. Setup page — new /mfa/setup route with inline authenticator enrollment and recovery codes, no account menu, no way out. Already-enrolled users are forwarded on. The originally intended destination is carried in redirectTo and sanitized with the same helper the login flow uses. Disabling blocked — at three layers: MultiFactorAuthenticationService.disableTotp throws ServiceValidationError (so every caller inherits the rule), the resource-route action refuses disable-mfa with a clean error, and MfaSetup hides the toggle and disable dialog when isRequired. Incidental fix — enableTotp now removes a previous pending secret before creating a new one. Refreshing the forced-setup page previously orphaned the old SecretReference and its stored secret on every retry. Reviewer notes An admin impersonating a user without MFA will be bounced to setup. That's intentional — the requirement applies to the impersonated session — but worth flagging since it changes impersonation ergonomics when the flag is on. /admin/api/* is not gated; those endpoints authenticate with API keys rather than dashboard sessions. Docs — docs/self-hosting/env/webapp.mdx (new row in the Auth table) and .server-changes/mfa-required.md (release note). Screenshots Unavailable — no container runtime in my environment to boot the webapp (see Testing). Happy to attach screenshots of the /mfa/setup page if wanted. 💯

Open Graph Description: Closes #5025 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Testing Automated apps/webapp/test/mfaRequ...

X Description: Closes #5025 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Testing Automated apps/webapp/test/mfaRequ...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/5034

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2d65b803-3445-6efd-c764-03b3f46628e0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEC2A:3FDCC4:131187E:1A93EC7:6AFADB94
html-safe-nonce1c8b382fa1399f71fd6b5ccdd089b4ef63747442b9b9afed0e8800ff0a835977
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzJBOjNGRENDNDoxMzExODdFOjFBOTNFQzc6NkFGQURCOTQiLCJ2aXNpdG9yX2lkIjoiNzU3ODIzOTc2MzAyNzQ0NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfe8cca5c5d0d45e1485d295c956152de85b206d44aa1e6f611634acd48d26bfa
hovercard-subject-tagpull_request:4898742928
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/5034/files
twitter:imagehttps://avatars.githubusercontent.com/u/177449033?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/177449033?s=400&v=4
og:image:altCloses #5025 ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works Testing Automated apps/webapp/test/mfaRequ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9d9bd51a568909a83d1abb9d6f74d68f0c87ca85fe3a56d3f5d70d8b89add9f2
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a7ae932999cc6d511008dbf980ff9efad2a31f7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/5034/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F5034%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F5034%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests65 (65)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
MauryaQbithttps://github.com/MauryaQbit
triggerdotdev:mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
MauryaQbit:feat/mfa-required-webapphttps://github.com/MauryaQbit/trigger.dev/tree/feat/mfa-required-webapp
Conversation 3 https://github.com/triggerdotdev/trigger.dev/pull/5034
Commits 1 https://github.com/triggerdotdev/trigger.dev/pull/5034/commits
Checks 2 https://github.com/triggerdotdev/trigger.dev/pull/5034/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/5034/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5034/files
feat(webapp): add MFA_REQUIRED env flag to enforce MFA for all dashboard users https://github.com/triggerdotdev/trigger.dev/pull/5034/files#top
Show all changes 1 commit https://github.com/triggerdotdev/trigger.dev/pull/5034/files
6b0c6c1 feat(webapp): add MFA_REQUIRED env flag to enforce MFA for all dashbo… Oct 17, 2026 https://github.com/triggerdotdev/trigger.dev/pull/5034/commits/6b0c6c1fc3a180e93afa36f062de818c990fde3e
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/5034/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5034/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5034/files
mfa-required.md https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-7e26fe11f4e9f6382bc406e074ef15cb101527b4172c5594fe3e8717f1f4b4c9
env.server.ts https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
root.tsx https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-d5455d1a6da2122394baafc207ac7f4776c717c515cbee94121ba1e939f12cee
route.tsx https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-8aa5104d094efceac57c8a1a08871a75b32b6d3cb818b8694c007a86c386f438
route.tsx https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-4aac7ac0f70ad240d7e8c3ff302025d7768d5b5f60ddd65fd2b4e5c1d04b87e4
route.tsx https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-e433f10900d4fd06ab6eb9e678a7bb3bc7ed892ede1c0682a3d30af5f26ae963
route.tsx https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-dacc4fd78eee6e975a23a3b7c1aefebf6300ce451040abd83d760d1d5323e3ee
useMfaSetup.ts https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-52b521bbed5938c3c6039a8ee649c16953ec4d20cf8c4c7482a29342d9b1edb4
mfaRequirement.server.ts https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-77e31f89643da72d63a634b9af1dfc550f143570a07a6448e00c9f35932d79e1
multiFactorAuthentication.server.ts https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-0df29d0d0a360e4f737283d2f5cd2b7a85d7e25f9c3d2e5cc601f26fd237bc03
session.server.ts https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-29ba17ba87f7943e0d20fa2c2a3daa2cfd697e8daba40e37d99d76903afd5b8e
pathBuilder.ts https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-f08ba069e49e36869e0cebfb995a9a34179bb213169836e962a34d907cd587d3
mfaRequirement.test.ts https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-a4c7a0869e18b3471d618b2b32df16a04c5e51c8292ff3eda67e85e238deda9a
webapp.mdx https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-f8dd5e39afbaf8985d144672a9af1d24bf9f4b7fe14c1d3156b500cee6da2421
.server-changes/mfa-required.mdhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-7e26fe11f4e9f6382bc406e074ef15cb101527b4172c5594fe3e8717f1f4b4c9
View file https://github.com/MauryaQbit/trigger.dev/blob/6b0c6c1fc3a180e93afa36f062de818c990fde3e/.server-changes/mfa-required.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5034/{{ revealButtonHref }}
apps/webapp/app/env.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
View file https://github.com/MauryaQbit/trigger.dev/blob/6b0c6c1fc3a180e93afa36f062de818c990fde3e/apps/webapp/app/env.server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5034/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
apps/webapp/app/root.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-d5455d1a6da2122394baafc207ac7f4776c717c515cbee94121ba1e939f12cee
View file https://github.com/MauryaQbit/trigger.dev/blob/6b0c6c1fc3a180e93afa36f062de818c990fde3e/apps/webapp/app/root.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5034/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-d5455d1a6da2122394baafc207ac7f4776c717c515cbee94121ba1e939f12cee
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-d5455d1a6da2122394baafc207ac7f4776c717c515cbee94121ba1e939f12cee
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-d5455d1a6da2122394baafc207ac7f4776c717c515cbee94121ba1e939f12cee
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-d5455d1a6da2122394baafc207ac7f4776c717c515cbee94121ba1e939f12cee
apps/webapp/app/routes/_app/route.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-8aa5104d094efceac57c8a1a08871a75b32b6d3cb818b8694c007a86c386f438
View file https://github.com/MauryaQbit/trigger.dev/blob/6b0c6c1fc3a180e93afa36f062de818c990fde3e/apps/webapp/app/routes/_app/route.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5034/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-8aa5104d094efceac57c8a1a08871a75b32b6d3cb818b8694c007a86c386f438
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-8aa5104d094efceac57c8a1a08871a75b32b6d3cb818b8694c007a86c386f438
apps/webapp/app/routes/account.security/route.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-4aac7ac0f70ad240d7e8c3ff302025d7768d5b5f60ddd65fd2b4e5c1d04b87e4
View file https://github.com/MauryaQbit/trigger.dev/blob/6b0c6c1fc3a180e93afa36f062de818c990fde3e/apps/webapp/app/routes/account.security/route.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5034/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-4aac7ac0f70ad240d7e8c3ff302025d7768d5b5f60ddd65fd2b4e5c1d04b87e4
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-4aac7ac0f70ad240d7e8c3ff302025d7768d5b5f60ddd65fd2b4e5c1d04b87e4
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-4aac7ac0f70ad240d7e8c3ff302025d7768d5b5f60ddd65fd2b4e5c1d04b87e4
https://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-4aac7ac0f70ad240d7e8c3ff302025d7768d5b5f60ddd65fd2b4e5c1d04b87e4
apps/webapp/app/routes/mfa.setup/route.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/5034/files#diff-e433f10900d4fd06ab6eb9e678a7bb3bc7ed892ede1c0682a3d30af5f26ae963
View file https://github.com/MauryaQbit/trigger.dev/blob/6b0c6c1fc3a180e93afa36f062de818c990fde3e/apps/webapp/app/routes/mfa.setup/route.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/5034/{{ revealButtonHref }}
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/5034/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.