From ac405c49e23e96663e01f958d0ce8a585ce4323d Mon Sep 17 00:00:00 2001 From: 0x24a Date: Sat, 7 Mar 2026 15:07:32 +0800 Subject: [PATCH] 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 --- internal/channel/inbound/identity.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/channel/inbound/identity.go b/internal/channel/inbound/identity.go index 3ab94224..ee56095c 100644 --- a/internal/channel/inbound/identity.go +++ b/internal/channel/inbound/identity.go @@ -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) {