diff --git a/app/ApiKey.php b/app/ApiKey.php
deleted file mode 100644
index 0ed33ff..0000000
--- a/app/ApiKey.php
+++ /dev/null
@@ -1,25 +0,0 @@
-belongsTo('App\User', 'owner_user_id', 'id');
- }
-}
diff --git a/app/Http/Controllers/ApiKeyController.php b/app/Http/Controllers/ApiKeyController.php
deleted file mode 100644
index f725ec4..0000000
--- a/app/Http/Controllers/ApiKeyController.php
+++ /dev/null
@@ -1,95 +0,0 @@
-authorize('viewAny', ApiKey::class);
-
- return view('dashboard.administration.keys')
- ->with('keys', ApiKey::all());
- }
-
- /**
- * Store a newly created resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- */
- public function store(CreateApiKeyRequest $request)
- {
- $this->authorize('create', ApiKey::class);
-
- $discriminator = "#" . bin2hex(random_bytes(7));
- $secret = bin2hex(random_bytes(32));
-
- $key = ApiKey::create([
- 'name' => $request->keyName,
- 'discriminator' => $discriminator,
- 'secret' => Hash::make($secret),
- 'status' => 'active',
- 'owner_user_id' => Auth::user()->id
- ]);
-
- if ($key)
- {
- $request->session()->flash('success', __('Key successfully registered!'));
- $request->session()->flash('finalKey', $discriminator . '.' . $secret);
-
- return redirect()
- ->back();
- }
-
- return redirect()
- ->back()
- ->with('error', __('An error occurred whilst trying to create an API key.'));
- }
-
-
- public function revokeKey(Request $request, ApiKey $key)
- {
- $this->authorize('update', $key);
-
- if ($key->status == 'active')
- {
- $key->status = 'disabled';
- $key->save();
- }
- else
- {
- return redirect()
- ->back()
- ->with('error', __('Key already revoked.'));
- }
-
- return redirect()
- ->back()
- ->with('success', __('Key revoked. Apps using this key will stop working.'));
-
- }
-
- /**
- * Remove the specified resource from storage.
- */
- public function destroy($id)
- {
- $key = ApiKey::findOrFail($id);
- $this->authorize('delete', $key);
-
- $key->delete();
-
- return redirect()
- ->back()
- ->with('success', __('Key deleted successfully. Apps using this key will stop working.'));
-
- }
-}
diff --git a/app/Http/Requests/CreateApiKeyRequest.php b/app/Http/Requests/CreateApiKeyRequest.php
deleted file mode 100644
index d7bf22c..0000000
--- a/app/Http/Requests/CreateApiKeyRequest.php
+++ /dev/null
@@ -1,30 +0,0 @@
- 'required|string'
- ];
- }
-}
diff --git a/config/adminlte.php b/config/adminlte.php
index 23d0b2c..32b0b5e 100755
--- a/config/adminlte.php
+++ b/config/adminlte.php
@@ -365,12 +365,6 @@ return [
'url' => '/admin/devtools',
'can' => 'admin.developertools.use',
],
- [
- 'text' => 'API Keys',
- 'icon' => 'fas fa-user-shield',
- 'can' => 'admin.settings.view',
- 'route' => 'keys.index'
- ]
],
],
[
diff --git a/database/migrations/2021_03_29_224932_api_keys.php b/database/migrations/2021_03_29_224932_api_keys.php
deleted file mode 100644
index 43a990d..0000000
--- a/database/migrations/2021_03_29_224932_api_keys.php
+++ /dev/null
@@ -1,42 +0,0 @@
-id();
- $table->string('discriminator');
- $table->string('secret');
- $table->enum('status', ['disabled', 'active']);
- $table->bigInteger('owner_user_id')->unsigned();
-
- $table->foreign('owner_user_id')
- ->references('id')
- ->on('users')
- ->cascadeOnDelete()
- ->cascadeOnUpdate();
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- //
- }
-}
diff --git a/database/migrations/2021_10_26_000036_add_linked_accounts_table.php b/database/migrations/2021_10_26_000036_add_linked_accounts_table.php
new file mode 100644
index 0000000..712b9fb
--- /dev/null
+++ b/database/migrations/2021_10_26_000036_add_linked_accounts_table.php
@@ -0,0 +1,28 @@
+{{__('messages.adm')}} / API Key Administration
-
-@stop
-
-@section('js')
-
-
You can use the key discriminator to identify it's API calls in the logs.
-This is your API key: {{ session('finalKey') }}
-Please copy it now as it'll only appear once.
-Here, you can view and manage all API keys created by users in the app. You can't, however, use this page to access someone else's account.
-Name | -Discriminator | -Owner | -Status | -Last Used | -Last Modified | -Actions | -
---|---|---|---|---|---|---|
{{ $key->name }} | -{{ $key->discriminator }} | -{{ $key->user->name }} | -{{ ($key->status == 'disabled') ? 'Revoked' : 'Active' }} | -{{ ($key->last_used == null) ? 'No recent activity' : $key->last_used }} | -{{ $key->updated_at }} | -- @if ($key->status == 'active') - - @else - - @endif - - - | -
No API keys have been registered yet.
-