sequenceDiagram
participant Strava Oauth
participant Strava Data
participant Node Server
participant Webmap
Node Server-->>Webmap: Sends Oauth2 URL with<br/>redirect, client ID encoded
Webmap-->>Strava Oauth: Send user to OAUTH login on user interaction
Strava Oauth-->>Node Server: Redirect with code
Node Server-->>Strava Oauth: Obtain refresh, access token
Strava Oauth-->>Node Server: Reply with tokens
note over Node Server: Stores tokens in JWT cookie
Node Server-->>Webmap: 301: Redirect user back to webmap<br/>(strava window open?)
Webmap-->>Node Server: Request activities, routes
note over Node Server: Reads tokens from cookie<br/>and validates
Node Server-->>Strava Data: Requests routes/activities<br />using authentication from cookie
Strava Data-->>Node Server: Returns requested data
Node Server-->>Webmap: Returns requested data
Webmap-->>Node Server: Requests Activity data
note over Node Server: Authenticates request using JWT cookie
Node Server-->>Strava Data: Requests activity data
Strava Data-->>Node Server: Returns activity data
Node Server-->>Webmap: Returns activity data
note over Webmap: Passes data to route builder<br/>for preview