Guid: Disable modal automatic sign in modal/redirect on a secured page for unauthenticated user

5 Commentaires

  • Ifra Saqlain
    Community Moderator

    Hey Ian,

     

    When end-user/anonymous-user haven't access of any article or post and any article which is for only manager/agent then there would be shown authentication issue.

    Try this and any issue please let me know :)

     

    Thank You

    Team

    0
  • Ian Lintner

    We ended up overriding the sign in button other "locked" links for anonymous users to bring up a modal using Javascript/JQuery 

     

    // Replace the sign in button behavior to open custom modal with disclaimer/sign in links/etc.
    $('a.login').on('click', modalOpen);

    //// example custom modal function
    // const modalOpen = function() {
    // stop default sign in behavior
    // e.preventDefault();
    // e.stopPropagation();
    // e.stopImmediatePropagation();

    // exampleModal('Open!');
    //};

     

    0
  • Marci Abraham

    Hey Ian. Looks like you're doing something similar to what I need. I have tried adding your js to my Guide (removed the // where appropriate), but it didn't seem to have any effect, so perhaps I'm not understanding its intent.

    What I want to do is change the sign-in modal. Ideally, I just need to change the text at the bottom of the modal. By default, it says "New to {{HELPCENTER}}? Sign up" but I don't want anyone to sign up. They can already get emails just fine after submitting a ticket, so this idea of creating an account confuses our users.

    If you have any suggestions I'd be grateful!

    0
  • Ian Lintner

    I don't believe you can actually change the sign in modal itself. It appears to be an iframe or sandboxed content that is outside of the normal guide.

    I essentially created our own modal which only works because we are using single sign on only. Not the username/password.

    This is probably a feature request on customizing this process.

    0
  • Ian Lintner

    My javascript code only prevents the default modal from showing up when the user clicks the login link in the menu. 
    // Specifically this section
    e.preventDefault();
    e.stopPropagation();
    e.stopImmediatePropagation();


    $('a.login').on('click', function() { 
    // stop default sign in behavior
    e.preventDefault();
    e.stopPropagation();
    e.stopImmediatePropagation();
    // Your code here
    });
    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk