Forum Academy Marketplace Showcase Pricing Features

Restricted Access - Works in Dev Mode but not in Live Mode

Hello - I restrict user access to certain pages like so:

     1) I have a user field called "User Type"
     2) On Page Load - Navigate to a "Access Denial Page"...Only When Current User is (or is not) "[User Type]"

It works perfect in Dev mode, but every page is denied access in Live mode.

Any idea what might be happening?

You might check the Database to make sure your user is actually that user type. I made a mistake in my own app where I forgot to make my user the right type, and ran into a similar issue. I’d check there first, sometimes the easiest things are the problem!

Yeah @potentialthings - I make those mistakes too…its the first thing I checked - I tried a few different types with same result.

I have a conditional that changes my options in my sidebar depending on the user type and that is working…can’t put my finger on this one though.

Possibly because the “page has loaded event” triggers before the data is being pulled, so current user field shows a value of empty at the time of the action.

Possible workarounds: (untested)

  1. Add a condition on the data to the event: When page is loaded, AND when current user’s type is “wrongtypeforthispage”. Possibly the condition doesn’t need to be the same as the one on the action.

  2. Add a pause before the action where you conditionally navigate to another page.

When you pushed it to Live, you did also copy the database across?

@mishav - #1 solved the issue. The conditional must be on the event, rather than the action (I have no condition on the action and works as intended).

I actually had some pages like this, most the condition was on the action - which is why I thought there was an issue between live and dev - not the case though, nothing to do with live or dev.

Everything working as it should on live and dev now…thank you for your help.

1 Like