feat(api): add swagger docs, /api/user/me GET and PUT endpoints

This commit is contained in:
Dominik 2025-06-11 22:43:37 +02:00
parent 77653bcc69
commit 29af2439c9
Signed by: dominik
GPG key ID: 06A4003FC5049644
10 changed files with 2976 additions and 261 deletions

View file

@ -113,6 +113,18 @@ export const { handlers, signIn, signOut, auth } = NextAuth({
authorized({ auth }) {
return !!auth?.user;
},
session: async ({ session, token }) => {
if (session?.user) {
session.user.id = token.sub as string;
}
return session;
},
jwt: async ({ user, token }) => {
if (user) {
token.uid = user.id;
}
return token;
},
},
debug: process.env.NODE_ENV === 'development',
});