Jump to content

Amit

Members
  • Posts

    1
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    Amit got a reaction from activa in Shared Login Plugin   
    Hi, this is a question/feature request.  If the Shared Login plugin fails to validate the token, the page remains blank at 
    /plugin/shared_login/?t=1501259438&u=john%40customer.com&r=https%3A%2F%2Fexample.com%2Fclient%2Fplugin%2Fmyplugin%2Fclient_main%2F&h=4d49c89098eba2f70adccf4f1b8bffe4616263b09c06abd4470c24b820ddd656
    I intentionally broke the token to see the behavior.  Instead of staying at a blank page, it would be good if the plugin could just redirect to the given the redirect-url parameter.
    I made it work by updating plugins/shared_login/controllers/main.php 
    in index() method before "return false;" I added the redirect;
    ====
           if ($hash == $this->Companies->systemHash($time . $username . $uri, $key->value, 'sha256')
                && $time >= strtotime('-30 min')) {
                return $this->processSharedLogin($username, $uri);
            }
            $this->redirect($uri);
           return false;
    ====
     
    Alternatively maybe there could be an admin setting that defines what URL should be redirected to if there is an error.
  2. Like
    Amit got a reaction from mrrsm in Shared Login Plugin   
    Hi, this is a question/feature request.  If the Shared Login plugin fails to validate the token, the page remains blank at 
    /plugin/shared_login/?t=1501259438&u=john%40customer.com&r=https%3A%2F%2Fexample.com%2Fclient%2Fplugin%2Fmyplugin%2Fclient_main%2F&h=4d49c89098eba2f70adccf4f1b8bffe4616263b09c06abd4470c24b820ddd656
    I intentionally broke the token to see the behavior.  Instead of staying at a blank page, it would be good if the plugin could just redirect to the given the redirect-url parameter.
    I made it work by updating plugins/shared_login/controllers/main.php 
    in index() method before "return false;" I added the redirect;
    ====
           if ($hash == $this->Companies->systemHash($time . $username . $uri, $key->value, 'sha256')
                && $time >= strtotime('-30 min')) {
                return $this->processSharedLogin($username, $uri);
            }
            $this->redirect($uri);
           return false;
    ====
     
    Alternatively maybe there could be an admin setting that defines what URL should be redirected to if there is an error.
×
×
  • Create New...