WVDSH-1588: re-mint gameplay JWT on forced refresh (?fresh=1)#39
Conversation
|
Claude finished @franzwarning's task in 1m 27s —— View job Code Review: WVDSH-1588 dev-server purchase route
Overall this is a clean, well-scoped addition that follows the conventions already established by 👍 What's good
🔸 Minor: error path hard-codes
|
The standalone paywall now grants entitlements directly via a gameplay-JWT mutation, so the dev server no longer mediates the purchase. It does need to stop hiding the new entitlement: /auth/refresh serves a cached JWT while still fresh, so a post-purchase forced refresh would return a stale token. Honor `?fresh=1` (sent by the SDK on forced refreshes) to skip the cache and re-mint from the backend, which also updates the cookie so a reload stays entitled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
f4d1c12 to
eaf3ef3
Compare
|
Claude finished @franzwarning's task in 1m 45s —— View job Code Review: WVDSH-1588 (current diff)
What the change actually does#[derive(Deserialize)]
struct RefreshParams {
fresh: Option<String>,
}
// ...
if p.fresh.is_none() {
if let Some(jwt) = cookie_value(&headers, &cfg.jwt_cookie_name()) {
if jwt_fresh(&cfg, &jwt).await {
return respond(StatusCode::OK, TEXT, None, jwt);
}
}
}When the SDK hits 👍 What's good
🔹 Nit:
|
What
Dev-server support for the standalone simulated paywall (WVDSH-1588).
Context
The standalone paywall now grants entitlements directly via a gameplay-JWT Convex mutation (
api.sdk.paidContent.mockPurchase), so the dev server no longer mediates the purchase — the earlier/__wavedash/purchaseroute is gone.How
/auth/refreshserves the per-browser gameplay JWT from a cookie while it's still fresh (sparing a backend round-trip). After a simulated purchase that cached token would hide the new entitlement, so the handler now honors?fresh=1(sent by the SDK on forced refreshes): skip the cache, re-mint from the backend, and update the cookie — which also keeps a reload entitled.Testing
Live through the real
wavedash dev: after a simulated purchase the forced refresh returns a token carrying the entitlement, and a fresh reload stays entitled.Paired with the sdk-js and wvdsh PRs. Linear: WVDSH-1588
🤖 Generated with Claude Code