Change hardcoded DEV HOST
This commit is contained in:
parent
a549dff9d6
commit
b889e008a4
|
@ -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);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
|
||||
define('OK', 'ok');
|
||||
define('ERR', 'err');
|
||||
define('OK', 'ok');
|
||||
define('ERR', 'err');
|
||||
define('HOST_DEV', 'http://127.0.0.1:8080');
|
||||
|
||||
$env = 'prod';
|
||||
if (getenv('ENV') !== false && in_array(getenv('ENV'), ['prod', 'dev']))
|
||||
|
|
Loading…
Reference in New Issue