Fix oauth endpoint

This commit is contained in:
Daniel Supernault 2025-01-04 16:39:19 -07:00
parent 79ebbc2d9f
commit 57ede29175
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -137,7 +137,10 @@ class ApiV1Controller extends Controller
'redirect_uris' => 'required', 'redirect_uris' => 'required',
]); ]);
$uris = implode(',', explode('\n', $request->redirect_uris)); $uris = collect(explode("\n", $request->redirect_uris))
->map('urldecode')
->filter()
->join(',');
$client = Passport::client()->forceFill([ $client = Passport::client()->forceFill([
'user_id' => null, 'user_id' => null,
@ -3494,7 +3497,7 @@ class ApiV1Controller extends Controller
return []; return [];
} }
$defaultCaption = ""; $defaultCaption = '';
$content = $request->filled('status') ? strip_tags($request->input('status')) : $defaultCaption; $content = $request->filled('status') ? strip_tags($request->input('status')) : $defaultCaption;
$cw = $user->profile->cw == true ? true : $request->boolean('sensitive', false); $cw = $user->profile->cw == true ? true : $request->boolean('sensitive', false);
$spoilerText = $cw && $request->filled('spoiler_text') ? $request->input('spoiler_text') : null; $spoilerText = $cw && $request->filled('spoiler_text') ? $request->input('spoiler_text') : null;
@ -3687,7 +3690,7 @@ class ApiV1Controller extends Controller
} }
} }
$defaultCaption = config_cache('database.default') === 'mysql' ? null : ""; $defaultCaption = config_cache('database.default') === 'mysql' ? null : '';
$share = Status::firstOrCreate([ $share = Status::firstOrCreate([
'caption' => $defaultCaption, 'caption' => $defaultCaption,
'rendered' => $defaultCaption, 'rendered' => $defaultCaption,