I am following the "How to Build an Expense Reporting Application With Caspio / Part 4 of 5" tutorial on youtube and trying to make the authentication and redirect work. However, rather than using html pages I am using wordpress and a login page I created for this.
I have created the login page in WP (and other pages as per the tutorial) and successfully embedded the Caspio code. The login screen is there when I go to the login page and I can log in. However, once I log in I would expect the "login Screen" datapage to redirect me to the page in the code. That does not happen. What happens instead is that I am still on the same WP page (the page where the Caspio login is embedded) but now logged in into Caspio. It does not redirect me.
Other than using WP I am following the tutorial to the letter. I even tried to use google as destination for the operator role (last else) with no luck. I also tried to embed the code and to use the caspio plugin - no difference. I am currently using the free Caspio account for testing and learning.
I am using page Builder by siteOrigine and Astra Theme
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.
Question
PeterER8
Hi All!
I am following the "How to Build an Expense Reporting Application With Caspio / Part 4 of 5" tutorial on youtube and trying to make the authentication and redirect work. However, rather than using html pages I am using wordpress and a login page I created for this.
I have created the login page in WP (and other pages as per the tutorial) and successfully embedded the Caspio code. The login screen is there when I go to the login page and I can log in. However, once I log in I would expect the "login Screen" datapage to redirect me to the page in the code. That does not happen. What happens instead is that I am still on the same WP page (the page where the Caspio login is embedded) but now logged in into Caspio. It does not redirect me.
this is the code I am using in the HTML DtaPage
<script>
if("[@authfield:Users_Role]" == "Admin"){
window.location = ""https://mypage.com/Admin/";
}
else if if("[@authfield:Users_Role]" == "Regional Director"){
window.location = "https://mypage.com/dashboard-regional-director/";
}
else if if("[@authfield:Users_Role]" == "Local Director"){
window.location = "https://"https://mypage.com/dashboard-local-director/";
}
else if if("[@authfield:Users_Role]" == "Site Manager"){
window.location = "https://"https://mypage.com/dashboard-site-manager/";
}
else {
window.location = "https://google.com/";
}
</script>
What am I missing here?
Other than using WP I am following the tutorial to the letter. I even tried to use google as destination for the operator role (last else) with no luck. I also tried to embed the code and to use the caspio plugin - no difference. I am currently using the free Caspio account for testing and learning.
I am using page Builder by siteOrigine and Astra Theme
All help highly appreciated!
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
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.