Skip to content

✨ Add claims, quests, userinfo API and balance-claim page#18

Merged
Nlkomaru merged 1 commit intomainfrom
feat/add-claims-quests-userinfo
Mar 3, 2026
Merged

✨ Add claims, quests, userinfo API and balance-claim page#18
Nlkomaru merged 1 commit intomainfrom
feat/add-claims-quests-userinfo

Conversation

@Nlkomaru
Copy link
Member

@Nlkomaru Nlkomaru commented Mar 3, 2026

Summary

  • MineAuth APIから claims / quests / userinfo を取得するサーバー関数を追加
  • /balance-claim ルートを新設し、どんぐり残高から保護ブロックを購入できるページを実装
  • ホームページで保護ブロック数をランダム値から実データ表示に変更
  • 認証スコープに roles を追加、Vault APIエンドポイントを修正
  • プレイヤーマップの名前にblurエフェクトを追加

Changes

  • New files: get-my-claims.ts, get-quests.ts, get-userinfo.ts, purchase-claim-blocks.ts, balance-claim/index.tsx
  • Modified: index.tsx (home), sign-in-action.ts, get-vault-balance.ts, player-map/index.tsx, player.ts

Test plan

  • ログイン後のホームページで保護ブロック数が正しく表示される
  • /balance-claim ページで残高と保護ブロック数が表示される
  • 保護ブロック購入フォームが正常に動作する

Made with Cursor

- 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
@Nlkomaru Nlkomaru merged commit 9b2a000 into main Mar 3, 2026
1 check passed
@Nlkomaru Nlkomaru deleted the feat/add-claims-quests-userinfo branch March 3, 2026 00:33
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

🚀 Deploying MoriPath with Cloudflare Workers

Preview URL https://efd38d2b-moripath.nikomaru.workers.dev
Storybook URL https://7c4ecf3d-moripath-storybook.nikomaru.workers.dev

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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(),

Choose a reason for hiding this comment

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

P1 Badge 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;

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant