fix: admin token (#2687)

pull/2692/head
icey-yu 3 months ago committed by GitHub
parent 6259a49c61
commit 953ed22313
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -82,7 +82,7 @@ func (a *authDatabase) CreateToken(ctx context.Context, userID string, platformI
const adminTokenMaxNum = 30 const adminTokenMaxNum = 30
if platformID == constant.AdminPlatformID { if platformID == constant.AdminPlatformID {
if len(kickedTokenKey) > adminTokenMaxNum { if len(kickedTokenKey) > adminTokenMaxNum {
kickedTokenKey = kickedTokenKey[:adminTokenMaxNum] kickedTokenKey = kickedTokenKey[:len(kickedTokenKey)-adminTokenMaxNum]
} else { } else {
kickedTokenKey = nil kickedTokenKey = nil
} }

Loading…
Cancel
Save