dburles / meteor-two-factor

🔐 Two factor authentication package for accounts-password
https://atmospherejs.com/dburles/two-factor
MIT License
81 stars 16 forks source link

verifyAndLogin -> Match.where error #16

Open fmorau opened 6 years ago

fmorau commented 6 years ago

Hello! I found your package very useful, thank you for it! But I got a problem I can't find a way to solve.

For created user instead of logginWithPassword after email and password submit I want to confirm his email for signIn:

-> I'm using getAuthCode instead of ligginWithPassword:

screen shot 2018-03-21 at 10 00 04

-> afterwards I can get user and code in sendCode:

screen shot 2018-03-21 at 10 03 41

-> then, I'm getting email with a link to my component where I can read token from route:

screen shot 2018-03-21 at 10 04 58

-> after I'm following the link where my verification component trying to veryfyAndLogin

screen shot 2018-03-21 at 10 06 44

=> but I'm getting error:

screen shot 2018-03-21 at 10 08 25

I think that selector doesn't have access to state and can't provide such data as 'user' and 'password' to login. I think that I don't understand it properly and hope on your help!

Will be glad to contact in telegram if smth. My contacts: +375(29)182-52-97 / chelovekdrakon.

Sincerely Fiodar Morau.

vbelolapotkov commented 6 years ago

@chelovekdrakon I guess I can help you here.

You're right, userQuery (email or username) and password are stored locally in reactive dict and not accessible from new tab.

I'd suggest you to separate processes: email verification and login with two factor. Two factor login is for confirming identity, email verification is for confirming access to email inbox.

fmorau commented 6 years ago

@vbelolapotkov okey, thank you :)