去除 access_token 访问写库逻辑

This commit is contained in:
ryan
2026-06-11 09:09:17 +08:00
parent 6cbc368dc1
commit 616242fad8
8 changed files with 32 additions and 19 deletions
-4
View File
@@ -6,7 +6,6 @@ package oauth
import (
"net/http"
"time"
"github.com/Rain-kl/Wavelet/internal/common"
"github.com/Rain-kl/Wavelet/internal/db"
@@ -56,9 +55,6 @@ func LoginRequired() gin.HandlerFunc {
authenticated = true
tokenAuth = true
tokenAdmin = tokenRecord.IsAdmin
// update token last used time
now := time.Now()
db.DB(ctx).Model(&tokenRecord).Update("last_used_at", &now)
}
}
}
-1
View File
@@ -203,7 +203,6 @@ func RotateAccessToken(c *gin.Context) {
tokenRecord.TokenHash = newTokenHash
tokenRecord.MaskedToken = newMaskedToken
tokenRecord.LastUsedAt = nil // 轮换后重置使用时间
if err := db.DB(ctx).Save(&tokenRecord).Error; err != nil {
c.JSON(http.StatusOK, util.Err(err.Error()))