|
|
|
@ -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);
|
|
|
|
|