Commit 160d565
fix(plugin-auth): harden all user-facing auth URLs to an absolute https origin
Follow-up to the invitation-link fix (#2847). Audited every backend site that
builds a user-facing link and found the same latent flaw: they read the raw
`config.baseUrl`, so a bare-host value (no scheme) yielded relative-looking,
unclickable links. Routed them all through the hardened getCanonicalOrigin():
- better-auth `baseURL` (583) — source of the reset-password / verify-email /
magic-link email links.
- OAuth `loginPage` / `consentPage` (1723-1724).
- Device-authorization `verificationUri` (1811).
- Phone-invite SMS `{{baseUrl}}` (sendPhoneInviteSms, 2201).
Added tests: bare host promoted to https, explicit scheme/trailing slash
preserved (getAuthIssuer), and better-auth baseURL carries the scheme.
Full @objectstack/plugin-auth suite passes (406 tests).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NT4mx1fHXtkxery6MtLTsp1 parent ca98878 commit 160d565
4 files changed
Lines changed: 65 additions & 4 deletions
File tree
- .changeset
- packages/plugins/plugin-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
117 | 136 | | |
118 | 137 | | |
119 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
804 | 824 | | |
805 | 825 | | |
806 | 826 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
584 | 587 | | |
585 | 588 | | |
586 | 589 | | |
| |||
1720 | 1723 | | |
1721 | 1724 | | |
1722 | 1725 | | |
1723 | | - | |
| 1726 | + | |
1724 | 1727 | | |
1725 | 1728 | | |
1726 | 1729 | | |
| |||
1812 | 1815 | | |
1813 | 1816 | | |
1814 | 1817 | | |
1815 | | - | |
| 1818 | + | |
1816 | 1819 | | |
1817 | 1820 | | |
1818 | 1821 | | |
| |||
2198 | 2201 | | |
2199 | 2202 | | |
2200 | 2203 | | |
2201 | | - | |
| 2204 | + | |
2202 | 2205 | | |
2203 | 2206 | | |
2204 | 2207 | | |
| |||
0 commit comments