max / makenotwork
1 file changed,
+5 insertions,
-0 deletions
| @@ -319,6 +319,11 @@ async fn platform_promo_code_makes_item_free() { | |||
| 319 | 319 | async fn fan_plus_checkout_requires_login() { | |
| 320 | 320 | let mut h = TestHarness::new().await; | |
| 321 | 321 | ||
| 322 | + | // Establish a CSRF token first so the POST clears the CSRF gate and reaches | |
| 323 | + | // the auth check — otherwise the posture-independent CSRF origin gate | |
| 324 | + | // rejects the cold POST with 403 before login is ever evaluated. | |
| 325 | + | h.client.fetch_csrf_token().await; | |
| 326 | + | ||
| 322 | 327 | let resp = h.client.post_form("/stripe/fan-plus", "").await; | |
| 323 | 328 | // Should return 401 (not logged in) | |
| 324 | 329 | assert_eq!(resp.status, 401, "Fan+ checkout should require login"); |