Next-Auth types

Im trying to add type groups so I can have typings for my nextauth config. Can't seem to figure it out. Whats is the exact way I can do add the type for such
callbacks: {
signIn({ profile }) {
const { groups = [] } = profile; // <--- make groups typed
return groups.some(Boolean)
},
},
callbacks: {
signIn({ profile }) {
const { groups = [] } = profile; // <--- make groups typed
return groups.some(Boolean)
},
},
When I add type in types/next-auth.d.ts I get the type on profile but when I want to destructure it it doesn't contain the property I want
1 Reply
Mugetsu
MugetsuOP•3y ago
👀 Anyone ? Silly me.. this works
signIn ({ profile }) {
if (!profile) return false;

const { groups = [] } = profile;

return groups.some(Boolean);
},
signIn ({ profile }) {
if (!profile) return false;

const { groups = [] } = profile;

return groups.some(Boolean);
},
Want results from more Discord servers?
Add your server