• cvanderberg

    (@cvanderberg)


    I’m trying to implement this plugin, but after WordPress prompts me for my credentials, it redirects to
    /wp/oauth/authorize/

    I think it’s because I’m using Roots’ Trellis to maintain my WordPress installation, and I login using /wp/wp-admin/ in stead of the usual /wp-admin/, but I think this makes it not work. Where can I change the base url to fix this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter cvanderberg

    (@cvanderberg)

    I found the issue, and I don’t know if its intentional or not.

    You’re using site_url as function to determine the url which needs to be redirected to. In most cases this works, but I have a separate folder for my WordPress installation.

    My suggestion is to change it to home_url.

    List of files with site_url:

    oauth2-provider/examples.php:
       39  function custom_login_redirect() {
       40  	if ( ! is_user_logged_in() ) {
       41: 		wp_redirect( site_url() . '/custom-login?redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] );
       42  	}
       43  
    
    oauth2-provider/includes/admin/page-server-options.php:
      270                                     value="<?php echo $current_user->user_firstname; ?>" required/>
      271                              <input type="hidden" name="email" value="<?php echo $current_user->user_email; ?>"/>
      272:                             <input type="hidden" name="website" value="<?php echo site_url(); ?>"/>
      273  
      274                              <input type="submit" class="button button-primary" value="Request more information"/>
    
    oauth2-provider/includes/admin/page-server-status.php:
      107                              <input type="hidden" name="yourname" placeholder="Enter Your Name" value="<?php echo $current_user->user_firstname; ?>" required/>
      108                              <input type="hidden" name="email" value="<?php echo $current_user->user_email; ?>"/>
      109:                             <input type="hidden" name="website" value="<?php echo site_url(); ?>"/>
      110  
      111                              <input type="submit" class="button button-primary" value="Request more information"/>
    
    oauth2-provider/includes/admin/pages/manage-clients.php:
       60                              <input type="hidden" name="yourname" placeholder="Enter Your Name" value="<?php echo $current_user->user_firstname; ?>" required/>
       61                              <input type="hidden" name="email" value="<?php echo $current_user->user_email; ?>"/>
       62:                             <input type="hidden" name="website" value="<?php echo site_url(); ?>"/>
       63  
       64                              <input type="submit" class="button button-primary" value="Request more information"/>
    
    oauth2-provider/includes/filters.php:
      171  	}
      172  	$response_object->data['authentication']['oauth2'] = array(
      173: 		'authorize' => site_url( 'oauth/authorize' ),
      174: 		'token'     => site_url( 'oauth/token' ),
      175: 		'me'        => site_url( 'oauth/me' ),
      176  		'version'   => '2.0',
      177  		'software'  => 'WP OAuth Server'
    
    oauth2-provider/library/class-wo-api.php:
      144  	 */
      145  	if ( ! is_user_logged_in() ) {
      146: 		wp_redirect( wp_login_url( site_url( $_SERVER['REQUEST_URI'] ) ) );
      147  		exit;
      148  	}
      ...
      176  
      177  				wp_logout();
      178: 				wp_redirect( site_url( add_query_arg( array( 'ignore_prompt' => '' ) ) ) );
      179  				exit;
      180  
    
    oauth2-provider/library/templates/grant-request.php:
       22  
       23  	// Safely redirect the user back through the request but without prompt
       24: 	wp_safe_redirect( site_url( add_query_arg( array( 'prompt' => '' ) ) ) );
       25  }
    Thread Starter cvanderberg

    (@cvanderberg)

    I thought I fixed it, but it still redirects me to the /wp/oauth/ url.

    Plugin Author Justin Greer

    (@justingreerbbi)

    Hi and sorry for the ate reply. I will have a look today when I get into the office.

    Thread Starter cvanderberg

    (@cvanderberg)

    Any luck yet?

    Thread Starter cvanderberg

    (@cvanderberg)

    Do you reckon I have to look for another solution or can you solve this with/for me?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Different permalink’ is closed to new replies.