The sample code looks as if it will adapt however it is 20 years since I coded would the changes work, plus I want to include Onboarding, Login, Registration, Email Validation - can you clarify what the other screen names would be?
var loginScreen = 123;
var hasSession = session && session.entries && session.entries.dataSource;
var isAllowed = hasSession && session.entries.dataSource.data[‘verifiedAt’] == null;
Please put the page Id’s of all the pages you want excluded at the top. If a user is not logged and they try to access any other page then they will be take to the loginPage below.
You have two components, Registration and email validation. Currently they do not work together.
Email validation puts a datetime stamp in the user table in ‘ verifiedAt’.
Hence the query about the custom code – so it checks both registration and that verifiedAt has something in it.
Going to the page below it give the code sample. Which suggests session.entries.dataSource.data[‘foo’] !== ‘bar’; - modified would check the email validation.
Hi
I should have also said that in the code you show I can’t see how it also checks the email validation. But I haven’t coded for a very long time so may be mistaken.
Thank you for the clarification. In this case I suggest the following. This will check if your verifiedAt is not null and if it is then it will take you to the login page.