diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index d67d673a21..f097a93f70 100755 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -87,9 +87,8 @@ class ProfileController extends Controller * * @author [A. Gianotto] [] * @since [v4.0] - * @return View */ - public function api() + public function api(): \Illuminate\Contracts\View\View { // Make sure the self.api permission has been granted @@ -97,7 +96,7 @@ class ProfileController extends Controller abort(403); } - return view('account/api'); + return view('account/api')->with('tokens', Auth::user()->tokens()->get()); } /** diff --git a/resources/views/account/api.blade.php b/resources/views/account/api.blade.php index 8afe9a2a6d..2e97c99748 100644 --- a/resources/views/account/api.blade.php +++ b/resources/views/account/api.blade.php @@ -14,12 +14,12 @@
@if (!config('app.lock_passwords')) - - +{{-- --}} +{{-- --}} {{-- New Component --}} - + @else

{{ trans('general.feature_disabled') }}

@endif diff --git a/resources/views/components/personal-access-tokens/panel.blade.php b/resources/views/components/personal-access-tokens/panel.blade.php index 043b3d81c3..9f02b87da1 100644 --- a/resources/views/components/personal-access-tokens/panel.blade.php +++ b/resources/views/components/personal-access-tokens/panel.blade.php @@ -1,6 +1,7 @@ @props([ 'token_url' => url('oauth/personal-access-tokens'), 'scopes_url' => url('oauth/scopes'), + 'tokens' => [], ])
@@ -21,6 +22,61 @@
+
+ + @if($tokens->count() === 0) +

+ You have not created any personal access tokens. +

+ @endif + + + + @if($tokens->count() > 0) + + + + + + + + + @endif + + + + + @foreach($tokens as $token) + + + + + + @endforeach + + + + + +
NameCreatedExpiresDelete
+ {{ $token->name }} + + {{ $token->created_at }} + + {{ $token->expires_at }} + + + + +
+
+ + + + + + \ No newline at end of file