
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2017 07:46 AM
Hi,
I am having issues when users login using side_door.do. They are redirected to the ITIL homepage (nav_to.do?uri=/side_door.do) and the homepage contains a Page not found error as I am already logged in. To resolve this error I am trying to re-direct users to Welcome.do or home.do instead using the SPEntryPage script (getFirstPageURL). However, when I try to return "/nav_to.do?uri=/home.do", I get a browser error saying there has been too many redirects.
If on the script, I return other pages such as /welcome.do, I am just redirected to the page without the Application Navigator and Banner frame.
Does anyone have an idea how I could redirect to the ITIL homepage with the main frame containing either welcome.do or home.do?
Here is a quick snippet of the getFirstPageURL method inside SPEntryPage, I have highlighted the code in red which I am trying to fix.
getFirstPageURL: function() {
var session = gs.getSession();
this.logProperties('before', session);
gs.log("SPEntryPage Logs getFirstPage");
// has roles and is not a Service Portal page - go to UI16
var nt = session.getProperty("nav_to");
var isServicePortalURL = new GlideSPScriptable().isServicePortalURL(nt);
var redirectURL = session.getProperty("login_redirect");
if ((user.hasRole('admin')) && !redirectURL && !isServicePortalURL)
return;
if (user.hasRole('itil') && !redirectURL && !isServicePortalURL){
return "/nav_to.do?uri=/home.do";
}
// user may have logged in from a frame, the /login_redirect.do page will bust out of it
if (!redirectURL) {
// redirectURL is nav_to
// if nav_to == "welcome.do" then use starting_page
var sPage = session.getProperty("starting_page");
if (sPage && nt == "welcome.do")
nt = sPage;
// Avoid a redirect loop to the home page
if (nt) {
var ep = gs.getProperty("glide.login.home");
if (ep == nt)
nt = null;
}
session.putProperty("login_redirect", nt || "true");
gs.log("SPEntryPage Logs getFirstPage NT: "+nt);
return "/login_redirect.do?sysparm_stack=no";
}
session.clearProperty("login_redirect");
var returnUrl = this.portal;
if (redirectURL && redirectURL != "true") {
var spUrl = new GlideSPScriptable().mapUrlToSPUrl(redirectURL);
returnUrl = spUrl ? this.portal + "?" + spUrl : redirectURL;
}
this.logProperties('after', session);
return returnUrl;
},
logProperties: function(beforeOrAfter, session) {
if (!this.logVariables)
return;
},
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2017 06:55 AM
Hey,
Yes, I did solve it in the end, I had an OnLoad UI Script, which was interfering with this script. I have also replaced the code in red, with just 'return;' instead of returning a specific URI. What issue are you currently facing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2020 12:51 PM
Hi Kim,
were you able to resolve this?
I'm having a very similar issue.
Thanks
John Quinonez