Skip to content

Fix POSTGRES_URL validation ordering#121

Merged
Senthil455 merged 5 commits into
mainfrom
fix/issue-48-scim-postgres-check
Jun 17, 2026
Merged

Fix POSTGRES_URL validation ordering#121
Senthil455 merged 5 commits into
mainfrom
fix/issue-48-scim-postgres-check

Conversation

@Senthil455

Copy link
Copy Markdown
Owner

Move the if (!process.env.POSTGRES_URL) validation check before pool creation so it actually catches missing configuration instead of creating a pool with undefined connectionString. The SCIM_API_KEY default was already removed in a previous change.

Add backup_codes_shown flag to user_mfa table. Backup codes are only
returned on the initial setup request and marked as shown afterwards.
Re-running setup will regenerate codes but not display them. Add a
/mfa/rotate-backup-codes endpoint that requires current TOTP token
to view new backup codes.
Prevent token leak by removing the raw passwordless token from the API
response body. The token is still stored hashed in the database and can
be verified via /auth/passwordless/verify. The response now only returns
a generic success message.
Replace 4 fragile regex patterns for extracting NameID and SAML attribute
values with robust DOM-based extraction using the already-parsed XML
document. This fixes namespace sensitivity, encoding variations, and
CDATA handling issues. Also moves the DOMParser outside the
SAML_IDP_CERT conditional so it is always available for attribute
extraction.

@Senthil455 Senthil455 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Moves the POSTGRES_URL validation before pool creation, fixing the dead code issue where the pool was created with undefined connectionString before validation.

@Senthil455 Senthil455 merged commit bcb66ac into main Jun 17, 2026
4 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant