mirror of
https://github.com/friendica/friendica
synced 2025-04-24 12:30:10 +00:00
Repurposed OAuth frontend handling, store the scope
This commit is contained in:
parent
132e08edb8
commit
b18073d5a8
9 changed files with 121 additions and 139 deletions
|
@ -51,7 +51,7 @@ class Apps extends BaseApi
|
|||
|
||||
$name = $_REQUEST['client_name'] ?? '';
|
||||
$redirect = $_REQUEST['redirect_uris'] ?? '';
|
||||
$scopes = $_REQUEST['scopes'] ?? '';
|
||||
$scopes = $_REQUEST['scopes'] ?? 'read';
|
||||
$website = $_REQUEST['website'] ?? '';
|
||||
|
||||
if (empty($name) || empty($redirect)) {
|
||||
|
@ -67,6 +67,10 @@ class Apps extends BaseApi
|
|||
$fields['scopes'] = $scopes;
|
||||
}
|
||||
|
||||
$fields['read'] = (stripos($scopes, 'read') !== false);
|
||||
$fields['write'] = (stripos($scopes, 'write') !== false);
|
||||
$fields['follow'] = (stripos($scopes, 'follow') !== false);
|
||||
|
||||
if (!empty($website)) {
|
||||
$fields['website'] = $website;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue