【发布时间】:2021-12-10 10:30:00
【问题描述】:
我使用next-auth 更新了 v4 beta。但是令牌在刷新时继续嵌套,因为令牌转换为 token.token 到 token.token.token .... 在每次刷新时出于某种原因
jwt: async (token, user, account, profile, isNewUser) => {
return token;
},
【问题讨论】:
我使用next-auth 更新了 v4 beta。但是令牌在刷新时继续嵌套,因为令牌转换为 token.token 到 token.token.token .... 在每次刷新时出于某种原因
jwt: async (token, user, account, profile, isNewUser) => {
return token;
},
【问题讨论】:
它有效,但不知道为什么我需要一个解决方法(有点)
jwt: async (token, user, account, profile, isNewUser) => {
if (token?.token && token?.token?.user) token = { ...token.token };
return token; // ...here
},
【讨论】: