-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add trusted origins configuration for auth #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add trusted origins configuration for auth #84
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
dec9aab to
dff01d7
Compare
4b16b54 to
5fa792a
Compare
5fa792a to
f1df8e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
f1df8e8 to
7828f80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
7828f80 to
6e2cad4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 1 comment

Greptile Overview
Greptile Summary
This PR extracts the hardcoded
trustedOrigins: ["init://"]into a configurableAUTH_TRUSTED_ORIGINSenvironment variable with comprehensive regex-based parsing for HTTP/HTTPS origins, wildcard subdomains, and custom URL schemes.Key changes:
init://fromauth/options.tsAUTH_TRUSTED_ORIGINSenv var with CSV parsing and pattern matchingcreateAuth()configurationCritical issue:
AUTH_TRUSTED_ORIGINSis required but has no default value. When the environment variable is unset, the app will fail at runtime during env parsing. Since mobile authentication requires theinit://scheme (perAndroidManifest.xml:27), the default should include this value to prevent breaking existing functionality.Confidence Score: 2/5
Important Files Changed
AUTH_TRUSTED_ORIGINSenv var with comprehensive validation but missing.optional()or default value, causing runtime failures when unsettrustedOrigins: env.AUTH_TRUSTED_ORIGINSto auth config, may passundefinedwhen env var unsetSequence Diagram
sequenceDiagram participant EnvFile as Environment participant PresetFn as auth preset function participant Backend as Backend env module participant AuthSetup as convexAuth function EnvFile->>PresetFn: Read AUTH_TRUSTED_ORIGINS PresetFn->>PresetFn: Transform CSV to array PresetFn->>PresetFn: Check regex patterns PresetFn->>Backend: Provide processed value Backend->>AuthSetup: Pass trustedOrigins config AuthSetup->>AuthSetup: Configure CORS checking