accounts-phone icon indicating copy to clipboard operation
accounts-phone copied to clipboard

Accounts.verifyPhone() not working properly

Open vbnlohani opened this issue 8 years ago • 5 comments

Hey, Your package is really of great help, I just had a small issue.

Whenever i try to verify a phone number using the verifyPhone() method, it returns an error in the callback with error 403 saying not a valid code and the user in not logged in instead he is logged out ( I actually logged the user in and then based on whether the phone is verified or not i show him the verification page or home screen).

But after this execution, if i check the database, the user phone is verified and the next time the user logs in, he is directly shown the home page not the verification page.

Any help would be appreciated.

vbnlohani avatar Aug 15 '16 19:08 vbnlohani

The problem is the verifyPhone method in the file phone_server.js. It calls Accounts._clearAllLoginTokens(user._id); even when a new password is not passed to the method. For my use case, I just commented this line. The author's opinion here would be useful.

abhishekbatra avatar Dec 14 '16 05:12 abhishekbatra

Yep, I also had to comment that line.

vbnlohani avatar Dec 14 '16 06:12 vbnlohani

@abhishekbatra @Vaibhav241196 Hello guys, is there any side effect to comment this line ? Cheers

balibou avatar Dec 14 '16 10:12 balibou

The side effect could appear when users change their password. I'm not very familiar with meteor's accounts API, but I would guess that the referred line should be conditionally invoked in case of a changed password. I'll post here once I've experimented with this.

On Wed, Dec 14, 2016 at 4:23 PM, Benjamin Cherion [email protected] wrote:

@abhishekbatra https://github.com/abhishekbatra @Vaibhav241196 https://github.com/Vaibhav241196 Hello guys, is there any side effect to comment this line ? Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/okland/accounts-phone/issues/28#issuecomment-267004352, or mute the thread https://github.com/notifications/unsubscribe-auth/ADnU3SLKJ2RFKtXa3RlYnXLfSClicNsmks5rH8qXgaJpZM4JkrN5 .

abhishekbatra avatar Dec 14 '16 13:12 abhishekbatra

ok thanks @abhishekbatra

balibou avatar Dec 14 '16 13:12 balibou