Skip to content

Commit

Permalink
Use base58 encoded Twitter registration nonce value (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffyanta committed Apr 9, 2024
1 parent 3156971 commit 09849db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/code/async/user/twitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,14 @@ func (p *service) findVerifiedTipAccountRegisteredInTweet(ctx context.Context, t
}
tipAccount, _ := common.NewAccountFromPublicKeyBytes(decodedAddress)

nonce, err := uuid.Parse(nonceString)
decodedNonce, err := base58.Decode(nonceString)
if err != nil {
return nil, nil, errTwitterInvalidRegistrationValue
}
if len(decodedNonce) != 16 {
return nil, nil, errTwitterInvalidRegistrationValue
}
nonce, _ := uuid.FromBytes(decodedNonce)

decodedSignature, err := base58.Decode(signatureString)
if err != nil {
Expand Down

0 comments on commit 09849db

Please sign in to comment.