add links to public pages

This commit is contained in:
Peter Körner committed 2021-05-05 22:01:56 +02:00
1 parent 75394eed7e
commit 15a6799421
3 files changed
+19 -4

No files matched your search

+15 -1
View File
@@ -40,4 +40,18 @@ export default NextAuth({
}
})
],
});
callbacks: {
async jwt(token, user, account, profile, isNewUser) {
// Add username to the token right after signin
if (user?.username) {
token.username = user.username
}
return token;
},
async session(session, token) {
session.user = session.user || {}
session.user.username = token.username;
return session;
},
},
});