How to pre-fill the log-in email input

I’m not worried about any of the APIs. I’m worried about the user having to type their email address in every time they want to log in to the web app. There aren’t even any elements, let alone input elements, involved in the APIs.

The debug_mode parameter is likely being treated as a parameter for the clickrouter. Try url-encoding the & symbol so it is passed into the url parameter. Or the ? symbol as @fayewatson points out.

1 Like

Hey, that did work, thanks! I used %26 instead of & and the reset_pw page loaded in debug mode.

@mishav do you have any suggestions about how to have a User’s email ‘remembered’ as the initial content of an input, even though the log in action is happening within an API Workflow?

Haha yeah I answered the easy part.

As @fayewatson mentions, Bubble uses a cookie for storing guest user info, expires in three days as per Emmanuel. This probably won’t be useful, as I don’t think it stores info when logged in.

What you are after is accessing “Browser storage”, there are a few types, with various pros and cons. Generally it would need some javascript. I haven’t played with it yet from within Bubble, but here are some ideas …
http://www.w3schools.com/js/js_cookies.asp
http://www.w3schools.com/html/html5_webstorage.asp

Or there are some javascript libraries:


http://www.jstorage.info/

1 Like

An alternative is to have a text input with auto remember history turned on, like the opposite solution to this post:

1 Like

Oh no, I didn’t mean it like that :sweat_smile: I just knew you would have a better idea of what to do! Thank you for the info : )

@emmanuel Looks like this is a good time to ask if we’re missing something. Is there a way to have the initial content of an input field remember the user’s email after the user is logged out?

I have a field in my new app the prefills the email address. I hope that’s what you are looking for. By the way, you need to have remembered me checked.

I think what you need to do after that is have a workflow run on page load that says something like this. When current user email is not empty then…

@emmanuel So, I do have “remember the email” checked in the signup action. That’s all the reference says is necessary to get the browser to remember their email.

Is there another way to “remember” the user’s email every time they log in, other than the “log the user in” action?

More specifically, is there a way to remember the email during the password reset process?
The “send password reset email” action doesn’t have a remember option

Neither does the “reset password” action, but Bubble must know what email address is associated with the token, otherwise this process wouldn’t work.

@AliFarahat I suspect the problem is that Bubble only puts the email into a browser cookie during the “log in” action if “remember the email” is “yes”. I’m not using that action at all; I’m using the password reset action.

Understood, yes your right.

That’s correct, this is by design.

Is there another way to put the email text somewhere it will be accessible when the user is logged out?

Not currently.

Is this possible in your specific app?

Create another field on the user (SaveEmail). Populate this field with a unique string. You can use the UID of the user but for security reasons that could be odd - or not - your call.

After the user logs in, send additional data to the page (parameter). SaveEmail=CurrentUser’s SaveEmail’s value. If the user gets logged out and has to return to the login screen, have conditional formatting on the email input that if the page parameter SaveEmail is not empty, then pre-populate it’s value with Do A Search For -> users that have SaveEmail=Get data from URL -> SaveEmail’s value -> first item’s email. This should pre-populate the email of the user that just got logged out.

If the page parameter SaveEmail is empty, then leave the input blank as normal and have them type it in.

If you can cut down half of the frustrations with this hack, it might be better than nothing.

That’s an interesting idea. Do you have a suggestion on how to test it? The action that redirects the user to index happens before the user is actually logged in, so it can’t access data things.


See how “current user is logged in” returns no, and the other parameters return empty.

My thought is whatever workflow that you use to log the user in will have to add the page parameters. It has to be after the user logs in.

That’s the workflow in the screenshot. It’s the “reset password” action that changes the user’s credentials and it doesn’t force them to reauthenticate, so it must be logging them in.

I assumed they’d be logged in after that, but apparently the log in actually happens after that entire workflow is run because two actions later, at the “go to page index” action, “current user is logged in” returns “no.”

I am not familiar with logging in with an API Workflow - only with Bubble’s standard login.

I assume that you are creating a user and then sending them a tracking email with a link. Can that link have the parameter embedded in the URL? So whether or not the user is logged in, the page parameter includes the hidden field that would be used to identify the user and their email address. This way the Current User being logged in is irrelevant.