Skip to content

Commit 4d1e6c4

Browse files
committed
2025.02.22 next auth: update signin logic
1 parent 29fecd2 commit 4d1e6c4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

auth.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { MongoDBAdapter } from '@auth/mongodb-adapter';
22
import NextAuth from 'next-auth';
33
import authConfig from './auth.config';
44
import mongoClientPromise from './lib/mongo-client';
5-
import { ObjectId } from 'mongodb';
65

76
export const { handlers, signIn, signOut, auth } = NextAuth({
87
adapter: MongoDBAdapter(mongoClientPromise),
@@ -21,10 +20,7 @@ export const { handlers, signIn, signOut, auth } = NextAuth({
2120

2221
await db
2322
.collection('accounts')
24-
.updateOne(
25-
{ userId: new ObjectId(user.id) },
26-
{ $set: { githubId: profile?.node_id, githubLogin: profile?.login } },
27-
);
23+
.updateOne({ userId: user.id }, { $set: { githubId: profile?.node_id, githubLogin: profile?.login } });
2824
}
2925
return true;
3026
},

0 commit comments

Comments
 (0)