Skip to content

Commit 58c4b3a

Browse files
trashercedric-anne
authored andcommitted
Scopes is expected to be an array
Fix probably copy/pasted variables
1 parent 97555f2 commit 58c4b3a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/OAuthClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function prepareInputForAdd($input)
126126
$input['secret'] = $key->encrypt(self::getNewIDOrSecret());
127127

128128
$input['grants'] = json_encode($input['grants'] ?? []);
129-
$input['scopes'] = json_encode($input['scopes'] ?? []);
129+
$input['scopes'] = json_encode(empty($input['scopes']) ? [] : $input['scopes']);
130130

131131
if (empty($input['redirect_uri'])) {
132132
$input['redirect_uri'] = ['/api.php/oauth2/redirection'];
@@ -153,7 +153,7 @@ public function prepareInputForUpdate($input)
153153
$input['grants'] = json_encode($input['grants']);
154154
}
155155
if (isset($input['scopes'])) {
156-
$input['scopes'] = json_encode($input['scopes']);
156+
$input['scopes'] = json_encode(empty($input['scopes']) ? [] : $input['scopes']);
157157
}
158158
$input['redirect_uri'] = json_encode($input['redirect_uri'] ?? []);
159159

templates/pages/setup/oauthclient.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232

3333
{% import 'components/form/fields_macros.html.twig' as fields %}
3434

35-
<div class="asset {{ bg }}">
35+
<div class="asset">
3636
{{ include('components/form/header.html.twig') }}
3737

3838
{% set rand = random() %}
3939
{% set params = params ?? [] %}
4040
{% set field_options = {} %}
4141

4242
<div class="card-body d-flex flex-wrap">
43-
<div class="col-12 col-xxl-{{ item_has_pictures ? '9' : '12' }} flex-column">
43+
<div class="col-12 col-xxl-12 flex-column">
4444
<div class="d-flex flex-row flex-wrap flex-xl-nowrap">
4545
<div class="row flex-row align-items-start flex-grow-1">
4646
<div class="row flex-row">

0 commit comments

Comments
 (0)