feat: migrate IM identity and snowflake primary keys

This commit is contained in:
richjohnrambo
2026-08-18 01:15:21 +08:00
parent db322d80dd
commit bf562c7d56
27 changed files with 1071 additions and 482 deletions
+9 -10
View File
@@ -203,18 +203,17 @@ func (a *authenticator) UpdateRecord(ctx auth.AuthContext, rec *auth.Rec, secret
return nil, err
}
// Remove old tag from the list of tags
oldTag := a.name + ":" + login
for i, tag := range rec.Tags {
if tag == oldTag {
rec.Tags[i] = rec.Tags[len(rec.Tags)-1]
rec.Tags = rec.Tags[:len(rec.Tags)-1]
break
if a.addToTags {
oldTag := a.name + ":" + login
for i, tag := range rec.Tags {
if tag == oldTag {
rec.Tags[i] = rec.Tags[len(rec.Tags)-1]
rec.Tags = rec.Tags[:len(rec.Tags)-1]
break
}
}
rec.Tags = append(rec.Tags, a.name+":"+uname)
}
// Add new tag
rec.Tags = append(rec.Tags, a.name+":"+uname)
return rec, nil
}