mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user