Closed
Conversation
## 実装内容 ### エラー型定義 - @praha/error-factoryを使用したカスタムエラークラス定義 - エラーカテゴリ分類(UserOperationError / ServerError) - Phase 1ではSessionErrorのみ使用、他はPhase 2で使用予定 ### Sentry送信ロジック - apps/web側でサーバー系エラーのみSentryに送信 - エラーコンテキスト情報を付与 ### Server Actionへの適用 - sign-outアクションにResult型を適用 - @praha/byethrowを使用したエラーハンドリング ## 設計判断 - packages/authentication: エラー型定義のみ(@praha/error-factory) - apps/web: エラーハンドリング実装(@praha/byethrow)、Sentry送信 - 責務を明確に分離し、認証パッケージはフレームワークに依存しない 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
🗑️ Preview Environment Cleaned Up✅ プレビュー環境をクリーンアップしました! Database Name: preview-pr356-auth
|
Contributor
🚀 Preview Environment Ready✅ プレビュー環境のセットアップが完了しました! 🗄️ DatabaseName: preview-pr356-auth 🌐 DeploymentPreview URL: https://next-lift-efs4s1eqm-gntks-projects.vercel.app
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
OAuth認証のエラーハンドリング基盤を実装しました(Phase 1)。
実装内容
1. エラー型定義 (
packages/authentication/src/errors.ts)@praha/error-factoryを使用したカスタムエラークラスPhase 1で使用:
SessionErrorのみPhase 2で使用予定:
OAuthProviderError,OAuthCancelledError,NetworkError,DatabaseError,InvalidConfigurationError2. Sentry送信ロジック (
apps/web/src/lib/report-authentication-error.ts)3. Server Actionへの適用
sign-outアクションに@praha/byethrowのResult型を適用Result.try()でエラーをキャッチResult.isFailure()でチェック設計判断
責務の分離
@praha/error-factoryのみ使用)@praha/byethrowを使用)、Sentry送信これにより、認証パッケージがフレームワークに依存せず、再利用性が向上します。
Result型の使い方
redirect()はエラーをthrowするため、Server ActionからResult型を直接返すことはできません。代わりに以下のパターンを採用:
redirect()を実行次のステップ(Phase 2)
Phase 2では以下を実装予定:
詳細は
apps/web/docs/oauth-error-handling-handoff.mdを参照してください(コミット対象外のため、ローカルで確認可能)。チェックリスト
🤖 Generated with Claude Code