mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 22:26:38 +08:00
去除 access_token 访问写库逻辑
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user