twilio / authy-ruby

**Deprecated** Ruby library to access the authy API
MIT License
156 stars 47 forks source link

Authy cannot verify token #17

Closed sohail-khalil closed 9 years ago

sohail-khalil commented 9 years ago

I am using authy and getting issue in verifying user. I successfully registered the user but failed to verify.

When i check user status it returns

{"status"=>{"authy_id"=>xxxxxx, "confirmed"=>true, "registered"=>false, "country_code"=>92, "phone_number"=>"XXX-XXX-3156", "devices"=>[], "has_hard_token"=>false, "account_disabled"=>false}, "message"=>"User status.", "success"=>true}

When i was verifying user by

Authy::API.verify(:id => xxxxxx, :token => token_on_app, :force => true)

it gives

{"success"=>false, "message"=>"Token format is invalid", "errors"=>{"message"=>"Token format is invalid"}}

but i am giving the correct token.

Please tell me what goes wrong? Thanks

dcu commented 9 years ago

token_on_app should be between 6 and 12 digits, otherwise the validation fails.