1
1
mirror of https://github.com/ZeroCatDev/ClassworksKV.git synced 2025-10-22 10:23:12 +00:00

Compare commits

...

2 Commits
v1.1.0 ... main

Author SHA1 Message Date
SunWuyuan
b20d8dab96
1.1.1 2025-10-07 20:17:22 +08:00
SunWuyuan
3c64226562
移除账户模型中的refreshToken字段,并将accessToken字段修改为可选 2025-10-07 20:17:11 +08:00
5 changed files with 14 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ClassworksKV",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"scripts": {
"start": "node ./bin/www",

View File

@ -0,0 +1 @@
-- This is an empty migration.

View File

@ -0,0 +1,9 @@
/*
Warnings:
- You are about to drop the column `refreshToken` on the `Account` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `Account` DROP COLUMN `refreshToken`,
MODIFY `accessToken` TEXT NULL;

View File

@ -29,8 +29,7 @@ model Account {
name String? // 用户名称
avatarUrl String? // 用户头像URL
providerData Json? // OAuth提供者返回的完整信息
accessToken String @db.Text // 账户访问令牌
refreshToken String? @db.Text // OAuth refresh token (如果提供者支持) - 可能很长,使用 TEXT
accessToken String? @db.Text // 账户访问令牌
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

View File

@ -310,7 +310,7 @@ router.get("/oauth/:provider/callback", async (req, res) => {
name: normalizedUser.name || account.name,
avatarUrl: normalizedUser.avatarUrl || account.avatarUrl,
providerData: userData,
refreshToken: tokenData.refresh_token || account.refreshToken,
//refreshToken: tokenData.refresh_token || account.refreshToken,
updatedAt: new Date(),
},
});
@ -326,7 +326,7 @@ router.get("/oauth/:provider/callback", async (req, res) => {
avatarUrl: normalizedUser.avatarUrl,
providerData: userData,
accessToken,
refreshToken: tokenData.refresh_token,
//refreshToken: tokenData.refresh_token,
},
});
}