File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
packages/manifest/backend/src/auth Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " manifest " : patch
3+ ---
4+
5+ Fix INVALID_ORIGIN error by automatically adding BETTER_AUTH_URL to trusted origins
Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ import Database from 'better-sqlite3';
99function getTrustedOrigins ( ) : string [ ] {
1010 const origins : string [ ] = [ ] ;
1111
12+ // Add BETTER_AUTH_URL to trusted origins (the app's own URL should always be trusted)
13+ if ( process . env . BETTER_AUTH_URL ) {
14+ // Remove trailing slash if present for consistency
15+ origins . push ( process . env . BETTER_AUTH_URL . replace ( / \/ $ / , '' ) ) ;
16+ }
17+
1218 // Add origins from ALLOWED_ORIGINS env var
1319 if ( process . env . ALLOWED_ORIGINS ) {
1420 origins . push ( ...process . env . ALLOWED_ORIGINS . split ( ',' ) . map ( ( o ) => o . trim ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments