Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always generate email token in registration, even if "email" has not sent #11

Open
yariksav opened this issue Jun 19, 2018 · 2 comments
Assignees

Comments

@yariksav
Copy link

What if user registration doing without "email", for example one of "uid" is phone number or username?
This code
https://github.com/adonisjs/adonis-persona/blob/dd573db6f328ef8c910b5dfdc40e751cfccc90a1/src/Persona.js#L491
always generate email token, even if email was not send

Perhaps need to add condition if email has sent?

@thetutlage
Copy link
Member

Yeah, we can improve it by introducing another config property called verificationTokenField.

  1. If this field is empty, no token will be generated
  2. If this field has value, a token for that value will be generated. You can use it to send email and as you mentioned, you can use it to send an SMS to the phone.

@yariksav
Copy link
Author

yariksav commented Aug 11, 2018

Hi @thetutlage!

If this field is empty, no token will be generated

Great idea! If some projects will have only username/password and work without email or phone

You can use it to send email and as you mentioned, you can use it to send an SMS to the phone.

But what if user can choose method of registration, by phone or by email address, or for two-factor authorization for instance.
In this logic we have to be able to send verification to both, or to one of them...
🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants