diff --git a/public/api/signup/mastodon/get_client.php b/public/api/signup/mastodon/get_client.php index bb2c2d4..73242e5 100644 --- a/public/api/signup/mastodon/get_client.php +++ b/public/api/signup/mastodon/get_client.php @@ -8,8 +8,8 @@ if ($instance === false) { } $app_name = conf('app_name', 'RealFan'); -$site_name = conf('site_name', 'http://127.0.0.1:8080'); -$redirect_uris = conf('site_name', 'http://127.0.0.1:8080'); +$site_name = conf('site_name', HOST_DEV); +$redirect_uris = conf('site_name', HOST_DEV).'/signup/mastodon:oauth'; $scopes = 'read write'; # create the Authorization App @@ -33,11 +33,10 @@ if ($result === null) { 'Instance failed to create an authorization App. Is it an instance?')); } -# create the URL for OAUTH -$query_string = http_build_query([ - 'client_id' => $result->client_id ?? null, - 'redirect_uris' => $redirect_uris, +# return authentication data +hres_json(200, OK, [ + 'instance' => $instance, + 'result' => $result, 'response_type' => 'code', 'scope' => $scopes ]); -hres_json(200, OK, $instance.'/oauth/authorize?'.$query_string); diff --git a/src/base.php b/src/base.php index c8ccc32..1f8de65 100644 --- a/src/base.php +++ b/src/base.php @@ -1,7 +1,8 @@