Current User info not available briefly after login - why? And how to work around?

I have a workflow in my app’s header that sends them to an email verification page if their ‘email confirmed’ is no, to make sure that they verify before using the app. This is the condition for running:

image

I send them to the page that has this header right after logging in, but what I’m finding is that this condition passes because Bubble has the Current User as logged in, but apparently doesn’t have any of the data for the Current User yet. I verified this by showing a popup inside that workflow that runs, and this is what it shows:

I thought that making sure the user is logged in would mean all Current User’s fields would be available, but apparently not.

Is there a workaround here? How can any workflows like this be reliable if the Bubble is saying the Current User is logged in but none of the fields are available until some unknown time after the actual login?

Have you tried adding on and Current user is not empty

Or try using the “User is logged in” event instead with the condition Current User's email confirmed is "no"

Might yield the same results but worth trying

1 Like

Can you give more details about you login processe? I don’t think your users are logged at all…

1 Like

@tylerboodman the Current User is not empty didn’t work, BUT instead of directing to a page at the end of the log in workflow, I used the User is logged in event and sent them to the index page there, and that seems to have worked. Thanks!

Below is the log in workflow I WAS using. Index is one of the pages with the header that has the workflows I posted above, and you can see that the workflow not only logs the use in but it also it only directs to the index page if they are logged in at that point. It’s strange to me that this didn’t work, but I guess it was operating on race conditions and the login was losing.

1 Like

@tylerboodman So, I spoke too soon. The issue persists; I discovered it is only happening when debug mode is off, but when debug mode is on it works correctly. I must have switched to debug mode while trying your solution and thought it worked. Debug_mode really shouldn’t change functionality, correct?

Any ideas on why this would be working in debug mode but not without it? To be clear, this isn’t between live and dev, this is between dev in debug mode and dev not in debug mode.

Debug mode slows down the whole process and allows the Current user’s data to filled in (stupid I know).

What is your workflow setup now compared to that last screenshot?

Much simpler, I removed the Go to page at then end of the login workflow and instead have this now:

I just added in a ridiculously long 5 second pause action before the go to page index, and it’s definitely not even waiting for that pause at all, just going straight to the page.

Pause doesn’t work for delaying between actions (just for on screen elements like animating popups, etc). You would need to schedule a custom event for 5 seconds in the future then have your “Go to page” action in that. Let me think about this one because I don’t like to arbitrarily set delays

Since your event is “User is logged in” try putting “Current user’s unique ID is not empty” condition on that. And don’t put anything on the “Go to page” action itself

1 Like

Was actually just coming here to post that that’s essentially what I did, except with the user’s email instead of unique ID.

1 Like

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