Open
Conversation
nibankougen
reviewed
Apr 24, 2026
| import { JWT } from "next-auth/jwt"; | ||
|
|
||
| declare module "next-auth" { | ||
| interface Session { |
There was a problem hiding this comment.
Q: この辺りの各種interfaceはどこで利用しているものでしょうか?
Contributor
Author
There was a problem hiding this comment.
使っているのはpages/api/auth/[...nextauth].tsですね。この辺入れておかないと形エラーになってしまうので入れた気がします
There was a problem hiding this comment.
IMO: 分かりました。declare module "next-auth" が1つのファイルに複数あるメリットはないと思うので、まとめていただけるとありがたいです。
| if (account?.accessToken) { | ||
| token.accessToken = account.access_token; | ||
| } | ||
| if (profile) { |
There was a problem hiding this comment.
Q: JWTのtoken.idへの代入が消されていますが、これは不要になったのでしょうか?
Contributor
Author
There was a problem hiding this comment.
console.logで値を見ていたのですが、元からprofileにidは入っていなさそうだったので消しました。おそらく最初に実装していた際に、NextAuthのサンプルコードなどを参考にしていたのではないでしょうか?
ちなみにprofileに入りうるのは { data : CurrentUserSerializer, ... } のようなデータです
Contributor
Author
|
conflictしてるっぽいんで rebaseします |
bbaefb5 to
19d8207
Compare
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.
NextAuth v4に対応しました。
NextAuth v3→v4は破壊的変更を大量に含んでいます。 https://next-auth.js.org/getting-started/upgrade-v4
また一部パッケージのバージョンを上げています。
他のパッケージも順次上げたいですが、一旦NextAuthのみの対応とします。