Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nicu Micle

    (@nicu_m)

    Hello @mpoole,

    This is a good idea for a new feature. I will add it in the next release.

    Meanwhile, there is an option in the plugin Include request parameters used for login link in the REDIRECT URL in the Login section. By enabling this,you can add a parameter like &page=your_page. If you check this, you can use the simple_jwt_login_redirect_hook.

    The script could look like this:

    
       add_action('simple_jwt_login_redirect_hook', function($url, $request){
           $page = isset($_REQUEST['page'])
               ? $_REQUEST['page']
               : null;
           if($page === null){
                wp_redirect($url);
                 return;
           } 
           switch($page){
              case "page1":
                  wp_redirect('https://site1.com');
                  break;
               case "page2": 
                  wp_redirect('https://site2.com');
                  break;   
           }
    },10,2);
    

    I will come back with updates once this new feature is released.

    Best regards,
    Nicu.

    Plugin Author Nicu Micle

    (@nicu_m)

    Hello @mpoole,

    I’ve implemented this feature in version v2.4.0. You can activate this feature from “Login settings”. The URL parameter that you should use is redirectUrl.

    Also, I’ve introduced the concept of variables. Now there are some variables that you can use in the redirect URLs.

    PS: Don’t forget to rate this plugin.

    Best regards,
    Nicu.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Dynamic Redirection URLs After Login’ is closed to new replies.