Open zedalaye opened 8 years ago
return
here is useless.
And I think it must also check that server_tokens is not blank and that all local tokens are contained in server_tokens :
def verify_tokens(tokens: @tokens)
server_tokens = refresh_tokens
!tokens.empty? && !server_tokens.empty? &&
(server_tokens.values_at(*tokens.keys) == tokens.values)
end
This method should probably just be removed, no other code depends on it and it isn't part of the core functionality of the client.
Maybe but it's very useful.
Hi,
It looks like verify_tokens can't be used to check whether the client has been paired with the BitPay server.
When no params has been passed and not tokens have been paired, it always returns true instead of false.
If tokens is empty, it will "not" return and so pass to the next expression and then return true.
I used this code as workaround :
I propose to rewrite verify_tokens as :
Or
all?
if all local tokens must match server tokens.