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

Centralize email configuration options #806

Closed
samtstern opened this issue Jul 18, 2017 · 18 comments
Closed

Centralize email configuration options #806

samtstern opened this issue Jul 18, 2017 · 18 comments

Comments

@samtstern
Copy link
Contributor

Right now we have an email option exposed on SignInIntentBuilder to allow new email accounts. We have multiple feature requests for other email flags:

I'd like to see these implemented but don't think we should keep hanging random options off the sign-in intent builder. Instead we'd like something like this (pseudocode):

new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER)
        .allowNewAccounts(false)
        .requireDisplayName(false)
        .requireEmailVerification(true)
        .build(),

This is a much more scalable way to add flags over time.

@WillieCubed
Copy link
Contributor

I could make a PR if you're not working on this already.

@samtstern
Copy link
Contributor Author

@TheCraftKid thanks! Not working on this already but do you want to quickly outline what you think the API in this issue before starting a PR? That way we don't have to go back and forth on PR comments.

@WillieCubed
Copy link
Contributor

This appears to be a good idea adding it to the IdpConfig.Builder, but would an option such as requireEmailVerification() on multiple identity providers make sense?

@samtstern
Copy link
Contributor Author

I am wondering if we could do something tricky.

Maybe AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER) would return a different Builder class that's a subclass of the generic one and includes email-specific options.

This pattern would also allow us to do the same for other methods. For instance we could make setPermissions only appear on Google/Facebook/Twitter since it doesn't make sense on Phone/Email.

@WillieCubed
Copy link
Contributor

Yeah, I was initially thinking generic classes would be the way to go. Just a bit more work. 😄

@WillieCubed
Copy link
Contributor

Would this be in 2.1.0, 2.2.0 or the next major release?

@samtstern
Copy link
Contributor Author

I think this can be done in the next release (which we are now calling 2.1.1 but would be renamed 2.2.0 if we had this change).

We can just mark the current email options as deprecated but not delete them, so it shouldn't be a breaking change.

@WillieCubed
Copy link
Contributor

Okay, LGTM, I'll get to work.

@WillieCubed
Copy link
Contributor

WillieCubed commented Jul 19, 2017

Okay, I want to squash #312, but the auth module is so dense, I don't know where to verify/check if the email is verified. Thoughts?

@samtstern
Copy link
Contributor Author

@TheCraftKid maybe we split this up into two tasks? The first is the new config object, the second is adding the missing flags.

There are some open questions for #312. I'd say what we want to do is fail email sign-in if we don't see emailVerified on the FirebaseUser but we probably need more UI and also email sending to make that happen. Probably a big task and should be a separate PR from the options object.

@samtstern
Copy link
Contributor Author

Also I'd prefer to tackle #467 before #312 since firebaseui-web already has the feature and it's much simpler to implement.

@jstimes
Copy link
Contributor

jstimes commented Oct 5, 2017

Hey @TheCraftKid are you still working on this? If not I'd be happy to take over.

@WillieCubed
Copy link
Contributor

Yeah, I meant to make sure this made it into version 3.0.0, but I got a bit busy on other projects. Let me make some more changes and push an updated version.

@ryandailey100
Copy link

@TheCraftKid When will this be finished by? I would like to have this implemented inside my app before I launch. Thanks 👍

@WillieCubed
Copy link
Contributor

WillieCubed commented Oct 10, 2017 via email

@ryandailey100
Copy link

Great! Sounds good to me. Thanks again

@WillieCubed
Copy link
Contributor

On second thought, it's possibly likely we're going to lump this in with #962, so there's no telling when that's going to be completed. It may be anywhere from a week to whenever it's done, but we may introduce a minor version bump with a fix for this. I wouldn't bet on that, though.

@samtstern
Copy link
Contributor Author

This has been fixed and released in version 3.2.0.

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

4 participants