fix(channel): return success when bind code is re-checked by same identity (#201)

* fix(channel): return success when bind code is re-checked by same identity

* style: run gofmt
This commit is contained in:
0x24a
2026-03-07 15:07:32 +08:00
committed by GitHub
parent bafd327b6b
commit ac405c49e2
+3
View File
@@ -384,6 +384,9 @@ func (r *IdentityResolver) tryHandleBindCode(ctx context.Context, msg channel.In
return IdentityDecision{Stop: true, Reply: channel.Message{Text: text}}
}
if !code.UsedAt.IsZero() {
if code.UsedByChannelIdentityID == channelIdentityID {
return true, reply(r.bindReply), code.IssuedByUserID, nil
}
return true, reply("Bind code already used."), "", nil
}
if !code.ExpiresAt.IsZero() && time.Now().UTC().After(code.ExpiresAt) {