Redirect homepage to My Activities page upon login.


3 Commentaires

  • Socorro Fernandez

    Hi Amie,

    I believe I was able to get a script to work as you described but I ended up placing the following code at the very end of home_page.hbs :

    $(document).ready(function() {
    if ((HelpCenter.user.role=="end_user")||(HelpCenter.user.role=="anonymous")) {

    I originally put this is script in the JS file but it continued to reload the page since I didnt have another condition to compare the current page and to not run the script. I decide to put the above code on the home_page.hbs which fixed the issue since it will only run if a user goes to the homepage.

    Please let me know if you have any questions or if you run into anything with this.


  • Sushant Awalekar
    Community Moderator

    Hi Amie,

    I have tested the same code snippet in my helpcenter and its working as expected.So Can you provide more details on where you have added this code in script.js ? 

  • Chris Cheung

    HI, i'm trying to do the same thing.  I redirect the login page to go to My Activities if already signed in.  Or we will take them to a different login page if not signed in.  But, if logged in, I don't want a "flash" of the default zendesk login page. 

    The issue is that we have styled the page with our logo.  This appears as an odd "wrong looking" splash page while the redirect happens.

    I have my redirect code (below) in the "document_head.hbs" which should be in the <head></head> tag. This should fire before anything on the body renders and redirect to the page we want. But still, a flash of the login screen appears.

    I think I'll try putting in some javascript to edit the CSS, like disappear the logo if you're on the login page. Anyone else run into this?

    if (window.location.pathname === "/hc/en-us") {
    {{#if signed_in}}



Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk