fix: lock conflict while changing view / fix: sign out not blocking refresh tokens

This commit is contained in:
Aaron Liu
2025-06-12 09:47:01 +08:00
parent e2dbb0404a
commit 3ab86e9b1d
3 changed files with 3 additions and 3 deletions

2
assets

Submodule assets updated: 6dc29be623...cdbc2861f9

View File

@@ -28,7 +28,7 @@ func (f *DBFS) PatchProps(ctx context.Context, uri *fs.URI, props *types.FilePro
// Lock target
lr := &LockByPath{target.Uri(true), target, target.Type(), ""}
ls, err := f.acquireByPath(ctx, -1, f.user, false, fs.LockApp(fs.ApplicationUpdateMetadata), lr)
ls, err := f.acquireByPath(ctx, -1, f.user, true, fs.LockApp(fs.ApplicationUpdateMetadata), lr)
defer func() { _ = f.Release(ctx, ls) }()
if err != nil {
return err

View File

@@ -198,7 +198,7 @@ func (s *RefreshTokenService) Delete(c *gin.Context) (string, error) {
// Block root token
if claims.RootTokenID != nil {
tokenSettings := dep.SettingProvider().TokenAuth(c)
dep.KV().Set(fmt.Sprintf("%s%s", auth.RevokeTokenPrefix, claims.RootTokenID.String()), true, int(tokenSettings.AccessTokenTTL.Seconds()+10))
dep.KV().Set(fmt.Sprintf("%s%s", auth.RevokeTokenPrefix, claims.RootTokenID.String()), true, int(tokenSettings.RefreshTokenTTL.Seconds()+10))
}
return "", nil