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

Remove uniqueness for email #1213

Closed
chaitanya-nyros opened this issue Sep 14, 2018 · 8 comments
Closed

Remove uniqueness for email #1213

chaitanya-nyros opened this issue Sep 14, 2018 · 8 comments

Comments

@chaitanya-nyros
Copy link

Please let me know how to remove duplicate email validation from this gem

Thanks.

@chaitanya-nyros chaitanya-nyros changed the title Remove duplicate email validation Remove uniqueness for email Sep 14, 2018
@dks17
Copy link
Contributor

dks17 commented Sep 14, 2018

@chaitanya-nyros hello.
Do you want sign up user with the same email more at once?

Try to create user with provider different from email and don't forget provide uid value.

@chaitanya-nyros
Copy link
Author

Yes I want signup user with same email more at once

But the provider is same.

I want to work this gem as bellow. Could you please guide me on this

Same email and provider bind to scope like organisation_id

@dks17
Copy link
Contributor

dks17 commented Sep 14, 2018

@chaitanya-nyros
I am not sure, but you can't sing up with the same email more than once. I think it is impossible.
You can try to set max_number_of_devices option and use the same email to sign in different devices.

# Sets the max number of concurrent devices per user, which is 10 by default.
# After this limit is reached, the oldest tokens will be removed.
# config.max_number_of_devices = 10

@chaitanya-nyros
Copy link
Author

Okay then is it possible to create user with same email and different provider?

@dks17
Copy link
Contributor

dks17 commented Sep 14, 2018

@chaitanya-nyros

Okay then is it possible to create user with same email and different provider?

Try. I have just assumed this.

You should also consider OmniAuth.
Actually I don't understand what you want from simple authentication by unique email.

You should also ask someone else.

@chaitanya-nyros
Copy link
Author

Yes I tried it is working thanks :)

@MaicolBen
Copy link
Collaborator

MaicolBen commented Sep 19, 2018

You can have the same email with different providers.
If you want it with the same provider, you can override email_provider? in user and return false, but that won't work because we always return the first user matched with that email.

@chaitanya-nyros
Copy link
Author

@MaicolBen

I customized the gem to work with same emails and different providers.

Thanks.

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

No branches or pull requests

3 participants