I’m trying to serve 1 of 3 buttons to visitors who hit my site:
sign up (for temporary users or those who cannot be verified as having an account)
log in (for signed up Users who can be verified as having an account)
log out (for logged in users)
Detecting if a current user is logged in/out is easy, but is anyone aware of any way to check if there is a database entry against User for the current user that is browsing?
One way could be to add a field to be assigned a value at signup. Then you can check if current user’s field is empty or not.
Example > Create a field called “date of signup” of type date. In your signup workflow add an action to assign the current date to this date field. And on page load check if the current user’s date of signup is empty or not. Bubble will check for the user object whether is temporary or not.
Hey cmarchan, I added a yes/no field called “membership” to test this out.
What exactly are you suggesting I do (in terms of workflow actions) on page load to check the current user’s membership? Set a state?
Without a workflow action on page load i’m able to get “sign up” to show (I assume because i haven’t pulled the current user’s membership status via a page load workflow), but login doesn’t show, even though Bubble keeps trying to auto-log me in, so i assume that the cookies are working correctly…
My understanding is that you want to serve different users different buttons.
You already have the correct condition:
Each of your buttons can react to visibility custom states as you deem appropriate. If you are not too familiar with how custom states work, perhaps this video could guide you: