Skip to content

Commit 9ab7762

Browse files
committed
feat: fixed error with rainbow login
1 parent 90ba4b8 commit 9ab7762

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

next.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ const config = {
4242
},
4343
// Append the default value with md extensions
4444
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
45+
webpack: (config) => {
46+
config.resolve.fallback = { fs: false, net: false, tls: false };
47+
return config;
48+
},
4549
};
4650

4751
export default withMDX(config);

src/server/auth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ export const authOptions: (ctxReq: CtxOrReq) => NextAuthOptions = ({
6060
// id: token.sub,
6161
// },
6262
// } as Session & { user: { id: string } }),
63-
session: ({ session, user }) =>
63+
session: ({ session, token }) =>
6464
({
6565
...session,
6666
user: {
6767
...session.user,
68-
id: user.id,
68+
id: token.sub,
6969
},
7070
} as Session & { user: { id: string } }),
7171
// OTHER CALLBACKS to take advantage of but not needed
@@ -219,8 +219,8 @@ export const authOptions: (ctxReq: CtxOrReq) => NextAuthOptions = ({
219219
return {
220220
// Pass user id instead of address
221221
// id: fields.address
222-
id: user.id,
223-
// ...user,
222+
// id: user.id,
223+
...user,
224224
};
225225
} catch (error) {
226226
// Uncomment or add logging if needed

src/types.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
declare global {
2+
interface BigInt {
3+
toJSON(): string;
4+
}
5+
}
6+
7+
BigInt.prototype.toJSON = function (): string {
8+
return this.toString();
9+
};

0 commit comments

Comments
 (0)