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

default email address not working for signup #1145

Open
nerocristallo opened this issue Apr 14, 2023 · 2 comments
Open

default email address not working for signup #1145

nerocristallo opened this issue Apr 14, 2023 · 2 comments

Comments

@nerocristallo
Copy link

nerocristallo commented Apr 14, 2023

I want to use two different flows for signin and signup

I am currently using "email" parameter in signIn method for pre-fill the email address
FUIEmailAuth.signIn(withPresenting: rootViewController, email: "[email protected]")

This method runs when I push the signIn button

    func signin() {
              
        self.authUI.tosurl = nil
        self.authUI.privacyPolicyURL = nil
        
        if let rootViewController = self.window?.rootViewController {
            let providerFUIEmailAuth = FUIEmailAuth(authAuthUI: self.authUI, signInMethod: EmailPasswordAuthSignInMethod, forceSameDevice: false, allowNewEmailAccounts: false, requireDisplayName: false, actionCodeSetting: ActionCodeSettings())
            let providers: [FUIAuthProvider] = [
                providerFUIEmailAuth
            ]
            self.authUI.providers = providers
            providerFUIEmailAuth.signIn(withPresenting: rootViewController, email: defaultEmail)
        }
        
    }

IMG_0014

and this one runs when I push the signUp button


    func signup() {

         self.authUI.tosurl = URL(string: "https://uptivo.fit/privacy-and-terms-of-use/")!
         self.authUI.privacyPolicyURL = URL(string: "https://uptivo.fit/privacy-and-terms-of-use/")!
         
         if let rootViewController = self.window?.rootViewController {
             let providerFUIEmailAuth = FUIEmailAuth(authAuthUI: self.authUI, signInMethod: EmailPasswordAuthSignInMethod, forceSameDevice: false, allowNewEmailAccounts: true, requireDisplayName: false, actionCodeSetting: ActionCodeSettings())
             let providers: [FUIAuthProvider] = [
                 providerFUIEmailAuth
             ]
             self.authUI.providers = providers
             providerFUIEmailAuth.signIn(withPresenting: rootViewController, email: defaultEmail)
         }
    }

IMG_0015

It is working fine for signIn but not for signUp
Is it a bug?
Is there any other way to pre-fill the signup email address?

@morganchen12
Copy link
Contributor

Do you get any errors when signing up? Are you able to sign up with the same email via Firebase Auth directly?

@nerocristallo
Copy link
Author

nerocristallo commented Apr 17, 2023

I do not see any error and if I manually fill the email with "[email protected]" (or any other fake email address) then the sign up procedure works properly.

The problem is not the signup procedure itself but the content of the email field at the beginning. It should not be empty but it should be the defaultEmail that I've specified in the FUIEmailAuth.signIn method.

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

2 participants