Hi
I hope all is well.
I want to integrate mongo into my application. I am using MoralisNextAuthProvider with the following code found here:
import NextAuth from 'next-auth';
import { MoralisNextAuthProvider } from '@moralisweb3/next';
export default NextAuth({
providers: [MoralisNextAuthProvider()],
// adding user info to the user session object
callbacks: {
async jwt({ token, user }) {
if (user) {
token.user = user;
}
return token;
},
async session({ session, token }) {
(session as { user: unknown }).user = token.user;
return session;
},
},
});
I noticed on the Connect to a Database with Web3 Authentication tutorial, the code looks a bit different.
How can I achieve the above with MoralisNextAuthProvider? I tried a few ways but it didn’t work.
Thanks in advance.