fix(api): preserve OTP enforcement during force_otp migration#120
Merged
fix(api): preserve OTP enforcement during force_otp migration#120
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
0015_org_force_otp.sqladdedorganizations.force_otpdefaulting tofalseand removed the legacyotp_requiredrole without migrating existing enforcement, which would silently disable OTP for orgs after upgrade.Description
packages/api/drizzle/0015_org_force_otp.sqlto backfillorganizations.force_otp = truefor any organization that had a member assigned the legacyotp_requiredrole.organization_member_roles,role_permissions, and therolesentry forotp_requiredunchanged.Testing
npm run tidywhich completed successfully (repo-wide Biome warnings/info remain but no errors).npm run buildwhich completed successfully for the workspaces though the brochureware prebuild logged a missing system library for Puppeteer PDF generation but did not fail the overall build.npm --workspace @DarkAuth/api test -- src/controllers/user/opaqueLoginFinish.test.ts, but tests could not be executed in this environment because Node v20 cannot run.tstest files directly and reportedERR_UNKNOWN_FILE_EXTENSION.Codex Task