FirebaseUI-iOS icon indicating copy to clipboard operation
FirebaseUI-iOS copied to clipboard

default email address not working for signup

Open nerocristallo opened this issue 2 years ago • 2 comments

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?

nerocristallo avatar Apr 14 '23 14:04 nerocristallo

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

morganchen12 avatar Apr 14 '23 23:04 morganchen12

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.

nerocristallo avatar Apr 17 '23 07:04 nerocristallo

Hello,

Thank you for taking the time to submit this bug.

A new release is planned shortly for SwiftUI native Auth that replaces the previous Auth FirebaseUI, which should resolve this request.

In the meantime, we will close this issue, if this is not resolved in the new version - please feel free to create a new issue.

russellwheatley avatar Nov 17 '25 13:11 russellwheatley