✨ Add claims, quests, userinfo API and balance-claim page#18
Conversation
- Add server functions: get-my-claims, get-quests, get-userinfo, purchase-claim-blocks - Add /balance-claim route for purchasing claim blocks with donguri balance - Display real remaining claim blocks on home page instead of random value - Add "roles" scope to MineAuth sign-in - Fix vault balance API endpoint path - Add UserInfoData type definition - Add blur effect to player names on map Made-with: Cursor
🚀 Deploying MoriPath with Cloudflare Workers
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e42f4e468d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [players, balance, userInfo, quests, claims] = await Promise.all([ | ||
| getOnlinePlayers(), | ||
| getVaultBalance().catch(() => 0), | ||
| getUserInfo(), |
There was a problem hiding this comment.
Stop blocking home loader on unused userinfo request
The home loader now awaits getUserInfo() even though Home never consumes userInfo, so the / route can fail whenever the userinfo call has a transient auth/network issue despite that data not being needed for rendering. This introduces avoidable homepage downtime and latency; make this fetch optional (like other .catch(() => null) calls) or remove it until the UI actually depends on it.
Useful? React with 👍 / 👎.
| Authorization: `Bearer ${tokenResult.accessToken}`, | ||
| }, | ||
| }); | ||
| const data = (await response.json()) as UserInfoData; |
There was a problem hiding this comment.
Check userinfo responses before treating them as valid data
getUserInfo casts response.json() directly to UserInfoData without verifying token presence or response.ok, so 401/500 responses can be returned as if they were valid user profiles (or throw later on non-JSON bodies). This makes downstream behavior unpredictable and hides authentication failures; handle missing access tokens and non-2xx statuses explicitly like the other API helpers.
Useful? React with 👍 / 👎.
Summary
/balance-claimルートを新設し、どんぐり残高から保護ブロックを購入できるページを実装rolesを追加、Vault APIエンドポイントを修正Changes
get-my-claims.ts,get-quests.ts,get-userinfo.ts,purchase-claim-blocks.ts,balance-claim/index.tsxindex.tsx(home),sign-in-action.ts,get-vault-balance.ts,player-map/index.tsx,player.tsTest plan
/balance-claimページで残高と保護ブロック数が表示されるMade with Cursor