File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -550,12 +550,24 @@ private function get_oauth_url() {
550550 session_start ();
551551 }
552552 $ consumer_key = isset ( $ _SESSION ['rop_mastodon_credentials ' ]['consumer_key ' ] ) ? $ this ->str_decrypt ( $ _SESSION ['rop_mastodon_credentials ' ]['consumer_key ' ] ) : '' ;
553+ $ domain = isset ( $ _SESSION ['rop_mastodon_credentials ' ]['md_domain ' ] ) ? $ _SESSION ['rop_mastodon_credentials ' ]['md_domain ' ] : 'mastodon.social ' ;
553554 if ( empty ( $ consumer_key ) ) {
554555 return false ;
555556 }
556557 $ url = $ this ->get_legacy_url ();
557558 $ scopes = $ this ->scopes ;
558- return "https://mastodon.social/oauth/authorize?client_id= $ consumer_key&redirect_uri= $ url&scope= $ scopes&response_type=code&state=mastodon " ;
559+
560+ $ auth_url = $ this ->get_api_endpoint ( $ domain , 'oauth/authorize ' );
561+ return add_query_arg (
562+ array (
563+ 'client_id ' => $ consumer_key ,
564+ 'redirect_uri ' => $ url ,
565+ 'scope ' => $ scopes ,
566+ 'response_type ' => 'code ' ,
567+ 'state ' => 'mastodon ' ,
568+ ),
569+ $ auth_url
570+ );
559571 }
560572
561573 /**
You can’t perform that action at this time.
0 commit comments