Skip to content

Add session auth, owned saved routes, and expiring shares - #15

Merged
SpencerLiang0114 merged 5 commits into
SpencerLiang0114:mainfrom
victory-c:feat/auth-on-imperial
Sep 22, 2026
Merged

SpencerLiang0114 merged 5 commits into
SpencerLiang0114:mainfrom
victory-c:feat/auth-on-imperial

Conversation

@victory-c

Copy link
Copy Markdown
Contributor

Summary

  • Session auth (register/login/logout) with CSRF (csrf.spa()), SameSite=Lax cookies, and safe ?next= redirects
  • Saved routes are per-user (list/get/save/rename/notes/delete); wizard/generate/geocode/OSM stay public so CI smoke stays unchanged
  • Per-user Strava OAuth with HMAC-signed state; explore uses the signed-in user’s tokens when present
  • Expiring share links (/share/{token}, default 7 days) with revoke; no fake “public visibility” UI

Stacks on #14 (imperial units). Prefer merging #14 first.

Why this is not the previous PR

  • CSRF enabled (not disabled)
  • Strava state is signed + expiring (not raw user id)
  • Auth only on saved-routes/account endpoints (wizard not broken)
  • Shares always expire; revoke endpoint included
  • No Playwright theater / overbuilt library filters

Test plan

  • ./mvnw test (excluding gated integration) — passed locally
  • pnpm lint, pnpm test, pnpm build — passed locally
  • Recreate API so Flyway applies V3__users_auth_shares.sql
  • Register → save route → rename/notes/delete as that user
  • Second account cannot read/update/delete the first user’s route
  • Create 7-day share → open /share/{token} logged out → after revoke, 404
  • Wizard generate still works while logged out
  • CI compatibility + integration jobs green

Made with Cursor

victory-c and others added 2 commits September 22, 2026 00:50
Distances now read "8.4 km (5.2 mi)" and elevations "142 m (466 ft)"
across route cards, saved routes, Strava picker, route summary and the
distance-goal presets. The elevation chart gains a feet axis on the
right and miles under each km label.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Protect account and saved-route APIs with CSRF-backed sessions while keeping
route generation public for the wizard. Strava OAuth uses signed state and
per-user tokens; share links expire by default after seven days.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI lite review requested due to automatic review settings September 22, 2026 08:20
@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

@victory-c is attempting to deploy a commit to the spencerliang0114's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

victory-c and others added 3 commits September 22, 2026 01:24
Cookie CSRF still protects auth and saved-route mutations; anonymous
generate/cache calls used by the wizard and CI must stay CSRF-free.

Co-authored-by: Cursor <cursoragent@cursor.com>
routing.ts now imports ./http; the smoke harness must resolve that
dependency instead of treating it as an unexpected require.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid Object.assign over getter-only re-export properties that
transpileModule emits for apiUrl.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
routecraft Ready Ready Preview Sep 22, 2026 2:53pm UTC

@SpencerLiang0114
SpencerLiang0114 merged commit b162d00 into SpencerLiang0114:main Sep 22, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 259c24ef Deployed Sep 22, 2026 by vercel[bot]
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.

3 participants