Creating admin acces in Live Mode

What’s the best/safest way to create an admin user and acces an admin page in live mode?

Thanks a lot.

1 Like

It actually says it on the default admin page:

“This page is currently visible to anyone that goes to this URL. You can restrict access to it by adding a ‘When the page is loaded’ event with the condition ‘the current user’s email isn’t youremail@example.com’ and redirecting the user to index in that case.”

How does it work if you want an “admin only” registration page (so if you are in Beta and want to create logons yourself).

Do you have to set up the admin user, then add the restriction ?

I think you’ll have to create a page with a standard sign up form + In the App Data, you should create a field “Admin” that is a yes/no type. Then In the sign up workflow you’ll have to put a condition that says: “when button sign up is clicked AND WHEN INPUT EMAIL = YOUR ADMIN EMAIL” => Sign the User Up (Email = input email; Password = Input password; Admin is YES)

Does this answer your question?

1 Like

Thanks, will have a play and see what happens.

I am not sure this is quite what I want. I am basically after an “admin only” signup page. But that makes it tricky as you then have no way to set up the admin user.

yes, for that one you probably need to use

  1. the admin panel, to manually modify your users and mark at as an admin
  2. build temporarily the workflow that does the operation, without protecting the page, and delete it after.

What you’re trying to do is quite “meta”, creating an admin page for an admin user that doesn’t exist yet, so you have to think about it creatively :slight_smile:

4 Likes

Thanks, will do just that.

One of the (many) things I like about bubble is that you do have to think creatively at times, think of another way of doing something. And it often turns out to be a lot simpler that what I was first thinking about. Which is so great.

3 Likes

I created a “system” user too, so an admin or a moderator can send messages, notifications, block spam etc using the “system” account instead of its private account.

1 Like

hi @NigelG

I see this post goes back a while now…but how did you manage to achieve this?

I am trying to figure out the best way to create an admin account in Live mode.

Now you can use the “account owners email” … or something like that ?

1 Like

sorry @NigelG not sure what you mean, are you able to elaborate?

I am trying to test a WF that will create and admin user in Live mode if the input email = Website admin email.

I am on a paid plan, but do I have to deployed in my own domain for this to work? if so…is there any other way to test my WF before going live?

Yes, you only get an admin email when you add a domain it seems.

Maybe the best way is to make it live without the check, quickly add an admin user, then update the live app to only allow access for that email ?

thanks @NigelG

doing that means updating about 8 WFs, its prob just as easier to leave them and move them to prod know that the admin email will match the input email value and thus running the actions as designed.

thanks again :slight_smile:

Add a field admin with type yes/no default - no,

After login page add a button to footer admin and hide it, when current user is admin=yes( which you can change to yes later by edit in data) show - button admin

And nevigat to a page you want to access to.

And run a workflow if user admin=no nevigate to page home. So no one can access the page

3 Likes

I have tried to do all of that stuff and it just doesn’t make sense to me I have an admin email but I need to know how to make it so only the person with the admin email can go to the page after clicking staff panel button