Jump to content
  • 0
Sign in to follow this  
nicholasnicola

Redirect if User not logged in

Question

Hello,

I have a HTML datapage acting as a stand alone login screen. When a user logs in, they are diverted to our online system.

If a user goes directly to the online system without going via the HTML data page (and thus not being logged in), I would like to automatically direct them to the HTML data page.

How can I do this?

Many thanks for any help.

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

These are the pages you need to have:

- A standalone login page (let's call it "login.htm")

- A landing page after successful login (let’s call it “mypage.htm”)

Step 1.

- Create an authentication folder. Open the authentication wizard and add a Header/Footer to configure fields screen

Put at the header

Step 2.

Also Attach the following script to the footer of the login form

var cb_login_page="login.htm";

if(!document.getElementById('cb_login_box') && document.getElementById('cb_login_module')){

window.location= cb_login_page;

} else {

document.getElementById("cb_login_module").style.display = "" ;

}

Step 3.

Create an custom HTML page inside the authentication folder. Attach the following script.

var landing_page = ‘mypage.htm’; // it could be relative or full path

window.location=landing_page;

Step 4.

- At the standalone login page “login.htm”. Wrap the Caspio Deploy code of custom HTML page with a div

Share this post


Link to post
Share on other sites
  • 0

Hi there,

I tried doing this but it doesn't seem to be working. The login page ends up just being blank. Can you confirm that all the code be you laid out is correct? Any suggestions on what I may have done wrong?

Thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...