🤖 Auto commit for release 'develop' on 2026-04-18

This commit is contained in:
JC5
2026-04-18 14:09:34 +02:00
parent fdcf73b775
commit c1816e2136
2 changed files with 14 additions and 14 deletions
@@ -44,14 +44,13 @@ final class OAuthController extends Controller
protected bool $internalAuth;
public function __construct(
protected ClientRepository $clients,
protected ClientRepository $clients,
protected ValidationFactory $validation
)
{
) {
parent::__construct();
$this->middleware(static function ($request, $next) {
app('view')->share('title', (string)trans('firefly.oauth_tokens'));
app('view')->share('title', (string) trans('firefly.oauth_tokens'));
app('view')->share('mainTitleIcon', 'fa-user');
return $next($request);
@@ -59,7 +58,6 @@ final class OAuthController extends Controller
$authGuard = config('firefly.authentication_guard');
$this->internalAuth = 'web' === $authGuard;
Log::debug(sprintf('ProfileController::__construct(). Authentication guard is "%s"', $authGuard));
}
public function destroyClient(Request $request, string $clientId): Response
@@ -77,7 +75,8 @@ final class OAuthController extends Controller
->each(function (#[SensitiveParameter] Token $token): void {
$token->refreshToken?->revoke();
$token->revoke();
});
})
;
$client->forceFill(['revoked' => true])->save();
@@ -109,7 +108,7 @@ final class OAuthController extends Controller
$repository = app(ClientRepository::class);
$repository->createPersonalAccessGrantClient('Firefly III Personal Access Grant Client', null);
}
$link = route('index');
$link = route('index');
return view('profile.oauth.index', compact('link'));
}
@@ -141,14 +140,15 @@ final class OAuthController extends Controller
->where('revoked', false)
->where('expires_at', '>', Date::now())
->get()
->filter(fn(#[SensitiveParameter] Token $token) => $token->client->hasGrantType('personal_access'));
->filter(fn (#[SensitiveParameter] Token $token) => $token->client->hasGrantType('personal_access'))
;
return response()->json($tokens);
}
public function regenerateClientSecret(Request $request, string $clientId): JsonResponse | Response
public function regenerateClientSecret(Request $request, string $clientId): JsonResponse|Response
{
$client = auth()->user()->oauthApps()->where('revoked', false)->find($clientId);
$client = auth()->user()->oauthApps()->where('revoked', false)->find($clientId);
if (null === $client) {
return new Response('', 404);
}
@@ -170,10 +170,10 @@ final class OAuthController extends Controller
// Creating an OAuth app client that belongs to the given user...
$client = app(ClientRepository::class)->createAuthorizationCodeGrantClient(
name : $request->input('name'),
name: $request->input('name'),
redirectUris: [$request->input('redirect_uris')],
confidential: $request->input('confidential'),
user : auth()->user()
user: auth()->user()
);
$arr = $client->toArray();
$arr['plainSecret'] = $client->plainSecret;
@@ -190,7 +190,7 @@ final class OAuthController extends Controller
return response()->json($request->user()->createToken($request->name));
}
public function updateClient(Request $request, string $clientId): Client | Response
public function updateClient(Request $request, string $clientId): Client|Response
{
$client = auth()->user()->oauthApps()->where('revoked', false)->find($clientId);