Dynamically redirect to "Signin" or "Signup"

Hi !
I’m trying to do something pretty standard (I think), but somehow I’m blocked…

There’s a “login” button in my front page menu, that leads to a “Login” page, where i only ask the user for an email adress. Then, I wanted to use this information to redirect the user to either the “Signup” page (if the email does’nt exist in the database) or to the “Signin” page (if the email already exists and the user is only requested to enter his password).

I wanted to do it this way, but it doesnt seem to work :

It always redirect to signup, never to signin.
When I launch the Step by step debug, it turns out that the workflow never finds the email (even though i know it exists).

I guess it’s perhaps linked to the privacy rules, but i cannot find my way around it.

Can you try search for user> first item is empty

I’m pretty sure that in order to log a user into your app they will need to have entered an email and a password. In this case if your user has only entered an email on your first page I’m not sure they will be counted as ‘logged in’ for your conditional ‘When the User is logged in’. This would be why it always redirects to signup.

You can read more about this in the manual here

Hi Siddharth !
Thanks for helping out - unfortunately this does not work neither :confused:

Hi Curran.
Thanks a lot for your message, but my question concerns the second workflow. The first one “when th user is logged in” works fine (it concerns the case when a user tries to load the login page while already signed up).

What I would like to do is not to log the user only with the email, but go with a two stepp approach :

  • Step 1 : please enter your email address
  • Step 2 (if the customer exists) : please enter your password to login
  • Step 2 (if the customer doesnt exist) : please create a new account

I don’t know if it’s clearer, but it’s pretty standard imo

U definitely need to consider this issue,

Yes definitely… I tried to tweak the privacy settings, but nothing worked. :frowning:
As it’s not an essential feature, I’m about to give up and go for a more traditional approach with two links (sign in / sign up) in the front end.

This is definitely a privacy issue. Whenever you search for something in User data type, it is most possibly a privacy issue. Just make its privacy settings all open and test it like that so you can identify if that’s about privacy.

1 Like

You can make a backend workflow with a text field for email, then a “Return data from API” action, Search for Users:count > 0 , constraint email = [email field]. So it returns a yes/no depending on a User exists or not.

Then setup the App Connector to itself so you can call that workflow and return data:

Then when they type their email and hit ENTER do the backend workflow, the resulting yes/no is for you to reference on the conditions for each step 2/3

3 Likes

I think by doing this search in the frontend youre exposing all of your emails to the user.

Yea you don’t want to expose the entire database of email addresses

Yes, that’s how it feels.
Thanks a lot everyone for your answers ! :slight_smile:

Apologies for misunderstanding. I see what you are trying to do now but I’m afraid I’ve only done it with the traditional way with username and password, which bubble seems to prefer. I understand why doing it the way you want would be nice for UX though.

This topic was automatically closed after 70 days. New replies are no longer allowed.