Skip to content

Commit

Permalink
Remove next-auth type
Browse files Browse the repository at this point in the history
  • Loading branch information
salimi-my committed Jan 30, 2024
1 parent 8a0ad66 commit 855a7ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
15 changes: 10 additions & 5 deletions auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ export const {
session.user.id = token.sub;
}

if (trigger === 'update' && newSession?.name && newSession?.email) {
session.user.name = newSession.name;
session.user.email = newSession.email;
}

if (session.user) {
session.user.name = token.name;
session.user.email = token.email;
}

if (
session.user &&
trigger === 'update' &&
newSession?.name &&
newSession?.email
) {
session.user.name = newSession.name;
session.user.email = newSession.email;
}

return session;
},
async jwt({ user, token, trigger, session }) {
Expand Down
14 changes: 0 additions & 14 deletions types/next-auth.d.ts

This file was deleted.

0 comments on commit 855a7ad

Please sign in to comment.