Skip to content

Commit 09849db

Browse files
authored
Use base58 encoded Twitter registration nonce value (#110)
1 parent 3156971 commit 09849db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/code/async/user/twitter.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,14 @@ func (p *service) findVerifiedTipAccountRegisteredInTweet(ctx context.Context, t
283283
}
284284
tipAccount, _ := common.NewAccountFromPublicKeyBytes(decodedAddress)
285285

286-
nonce, err := uuid.Parse(nonceString)
286+
decodedNonce, err := base58.Decode(nonceString)
287287
if err != nil {
288288
return nil, nil, errTwitterInvalidRegistrationValue
289289
}
290+
if len(decodedNonce) != 16 {
291+
return nil, nil, errTwitterInvalidRegistrationValue
292+
}
293+
nonce, _ := uuid.FromBytes(decodedNonce)
290294

291295
decodedSignature, err := base58.Decode(signatureString)
292296
if err != nil {

0 commit comments

Comments
 (0)