Skip to content

Commit 019e40f

Browse files
committed
refactor: Update GitHub profile ID handling for compatibility with database keys
1 parent 80cdf29 commit 019e40f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

auth.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const authConfig = {
5353
GitHub({
5454
profile(profile) {
5555
return {
56-
id: `github-${profile.id}`,
56+
id: profile.id.toString(),
5757
name: profile.name ?? profile.login,
5858
email: profile.email,
5959
image: profile.avatar_url,

auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const { handlers, auth, signIn, signOut } = NextAuth(() => {
2727
GitHub({
2828
profile(profile) {
2929
return {
30-
id: `github-${profile.id}`, // 让 User.id 直接对应 GitHub ID
30+
id: profile.id.toString(), // 与数据库的整数主键兼容
3131
name: profile.name ?? profile.login,
3232
email: profile.email,
3333
image: profile.avatar_url,

0 commit comments

Comments
 (0)