diff --git a/app/Http/Livewire/OauthClients.php b/app/Http/Livewire/OauthClients.php
new file mode 100644
index 000000000..0f7d130e9
--- /dev/null
+++ b/app/Http/Livewire/OauthClients.php
@@ -0,0 +1,109 @@
+clientRepository = app(ClientRepository::class);
+ $this->tokenRepository = app(TokenRepository::class);
+ parent::__construct();
+ }
+
+ public function render()
+ {
+ return view('livewire.oauth-clients', [
+ 'clients' => $this->clientRepository->activeForUser(auth()->user()->id),
+ 'authorized_tokens' => $this->tokenRepository->forUser(auth()->user()->id)->where('revoked', false),
+ ]);
+ }
+
+ public function createClient(): void
+ {
+ $this->validate([
+ 'name' => 'required|string|max:255',
+ 'redirect' => 'required|url|max:255',
+ ]);
+
+ $newClient = $this->clientRepository->create(
+ auth()->user()->id,
+ $this->name,
+ $this->redirect,
+ );
+
+ $this->dispatchBrowserEvent('clientCreated');
+ }
+
+ public function deleteClient(Client $clientId): void
+ {
+ // test for safety
+ // ->delete must be of type Client - thus the model binding
+ if ($clientId->user_id == auth()->user()->id) {
+ $this->clientRepository->delete($clientId);
+ } else {
+ Log::warning('User ' . auth()->user()->id . ' attempted to delete client ' . $clientId->id . ' which belongs to user ' . $clientId->user_id);
+ $this->authorizationError = 'You are not authorized to delete this client.';
+ }
+ }
+
+ public function deleteToken($tokenId): void
+ {
+ $token = $this->tokenRepository->find($tokenId);
+ if ($token->user_id == auth()->user()->id) {
+ $this->tokenRepository->revokeAccessToken($tokenId);
+ } else {
+ Log::warning('User ' . auth()->user()->id . ' attempted to delete token ' . $tokenId . ' which belongs to user ' . $token->user_id);
+ $this->authorizationError = 'You are not authorized to delete this token.';
+ }
+ }
+
+ public function editClient(Client $editClientId): void
+ {
+ $this->editName = $editClientId->name;
+ $this->editRedirect = $editClientId->redirect;
+
+ $this->editClientId = $editClientId->id;
+
+ $this->dispatchBrowserEvent('editClient');
+ }
+
+ public function updateClient(Client $editClientId): void
+ {
+ $this->validate([
+ 'editName' => 'required|string|max:255',
+ 'editRedirect' => 'required|url|max:255',
+ ]);
+
+ $client = $this->clientRepository->find($editClientId->id);
+ if ($client->user_id == auth()->user()->id) {
+ $client->name = $this->editName;
+ $client->redirect = $this->editRedirect;
+ $client->save();
+ } else {
+ Log::warning('User ' . auth()->user()->id . ' attempted to edit client ' . $editClientId->id . ' which belongs to user ' . $client->user_id);
+ $this->authorizationError = 'You are not authorized to edit this client.';
+ }
+
+ $this->dispatchBrowserEvent('clientUpdated');
+
+ }
+}
diff --git a/package-lock.json b/package-lock.json
index 4eecbaf17..6be5a9927 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -37,7 +37,6 @@
"sheetjs": "^2.0.0",
"tableexport.jquery.plugin": "1.28.0",
"tether": "^1.4.0",
- "vue-resource": "^1.5.2",
"webpack": "^5.89.0"
},
"devDependencies": {
@@ -46,10 +45,7 @@
"jquery": "<3.6.0",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.20",
- "postcss": "^8.4.5",
- "vue": "2.4.4",
- "vue-loader": "^15.9.7",
- "vue-template-compiler": "2.4.4"
+ "postcss": "^8.4.5"
},
"engines": {
"node": ">=0.12"
@@ -1996,16 +1992,6 @@
"node": ">= 8"
}
},
- "node_modules/@sindresorhus/is": {
- "version": "4.6.0",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sindresorhus/is?sponsor=1"
- }
- },
"node_modules/@swc/helpers": {
"version": "0.3.17",
"license": "MIT",
@@ -2013,16 +1999,6 @@
"tslib": "^2.4.0"
}
},
- "node_modules/@szmarczak/http-timer": {
- "version": "4.0.6",
- "license": "MIT",
- "dependencies": {
- "defer-to-connect": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/@tokenizer/token": {
"version": "0.3.0",
"license": "MIT"
@@ -2089,16 +2065,6 @@
"@types/node": "*"
}
},
- "node_modules/@types/cacheable-request": {
- "version": "6.0.3",
- "license": "MIT",
- "dependencies": {
- "@types/http-cache-semantics": "*",
- "@types/keyv": "^3.1.4",
- "@types/node": "*",
- "@types/responselike": "^1.0.0"
- }
- },
"node_modules/@types/clean-css": {
"version": "4.2.8",
"dev": true,
@@ -2176,10 +2142,6 @@
"@types/node": "*"
}
},
- "node_modules/@types/http-cache-semantics": {
- "version": "4.0.2",
- "license": "MIT"
- },
"node_modules/@types/http-errors": {
"version": "2.0.2",
"dev": true,
@@ -2238,13 +2200,6 @@
"version": "7.0.13",
"license": "MIT"
},
- "node_modules/@types/keyv": {
- "version": "3.1.4",
- "license": "MIT",
- "dependencies": {
- "@types/node": "*"
- }
- },
"node_modules/@types/mime": {
"version": "1.3.3",
"dev": true,
@@ -2282,13 +2237,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/@types/responselike": {
- "version": "1.0.1",
- "license": "MIT",
- "dependencies": {
- "@types/node": "*"
- }
- },
"node_modules/@types/retry": {
"version": "0.12.0",
"dev": true,
@@ -2342,59 +2290,6 @@
"@types/node": "*"
}
},
- "node_modules/@vue/component-compiler-utils": {
- "version": "3.3.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "consolidate": "^0.15.1",
- "hash-sum": "^1.0.2",
- "lru-cache": "^4.1.2",
- "merge-source-map": "^1.1.0",
- "postcss": "^7.0.36",
- "postcss-selector-parser": "^6.0.2",
- "source-map": "~0.6.1",
- "vue-template-es2015-compiler": "^1.9.0"
- },
- "optionalDependencies": {
- "prettier": "^1.18.2 || ^2.0.0"
- }
- },
- "node_modules/@vue/component-compiler-utils/node_modules/lru-cache": {
- "version": "4.1.5",
- "dev": true,
- "license": "ISC",
- "dependencies": {
- "pseudomap": "^1.0.2",
- "yallist": "^2.1.2"
- }
- },
- "node_modules/@vue/component-compiler-utils/node_modules/picocolors": {
- "version": "0.2.1",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/@vue/component-compiler-utils/node_modules/postcss": {
- "version": "7.0.39",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "picocolors": "^0.2.1",
- "source-map": "^0.6.1"
- },
- "engines": {
- "node": ">=6.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/postcss/"
- }
- },
- "node_modules/@vue/component-compiler-utils/node_modules/yallist": {
- "version": "2.1.2",
- "dev": true,
- "license": "ISC"
- },
"node_modules/@vue/reactivity": {
"version": "3.1.5",
"license": "MIT",
@@ -3544,11 +3439,6 @@
"node": ">=8"
}
},
- "node_modules/bluebird": {
- "version": "3.7.2",
- "dev": true,
- "license": "MIT"
- },
"node_modules/blueimp-canvas-to-blob": {
"version": "3.5.0",
"license": "MIT",
@@ -4027,29 +3917,6 @@
"node": ">= 0.8"
}
},
- "node_modules/cacheable-lookup": {
- "version": "5.0.4",
- "license": "MIT",
- "engines": {
- "node": ">=10.6.0"
- }
- },
- "node_modules/cacheable-request": {
- "version": "7.0.4",
- "license": "MIT",
- "dependencies": {
- "clone-response": "^1.0.2",
- "get-stream": "^5.1.0",
- "http-cache-semantics": "^4.0.0",
- "keyv": "^4.0.0",
- "lowercase-keys": "^2.0.0",
- "normalize-url": "^6.0.1",
- "responselike": "^2.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/cached-path-relative": {
"version": "1.1.0",
"license": "MIT"
@@ -4343,16 +4210,6 @@
"node": ">=6"
}
},
- "node_modules/clone-response": {
- "version": "1.0.3",
- "license": "MIT",
- "dependencies": {
- "mimic-response": "^1.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/codepage": {
"version": "1.15.0",
"license": "Apache-2.0",
@@ -4524,17 +4381,6 @@
"node_modules/console-browserify": {
"version": "1.2.0"
},
- "node_modules/consolidate": {
- "version": "0.15.1",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "bluebird": "^3.1.1"
- },
- "engines": {
- "node": ">= 0.10.0"
- }
- },
"node_modules/constants-browserify": {
"version": "1.0.0",
"license": "MIT"
@@ -4922,11 +4768,6 @@
"jquery": ">=1.7"
}
},
- "node_modules/de-indent": {
- "version": "1.0.2",
- "dev": true,
- "license": "MIT"
- },
"node_modules/debug": {
"version": "2.6.9",
"dev": true,
@@ -4935,29 +4776,6 @@
"ms": "2.0.0"
}
},
- "node_modules/decompress-response": {
- "version": "6.0.0",
- "license": "MIT",
- "dependencies": {
- "mimic-response": "^3.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/decompress-response/node_modules/mimic-response": {
- "version": "3.1.0",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/deep-equal": {
"version": "2.2.2",
"license": "MIT",
@@ -5000,13 +4818,6 @@
"node": ">= 10"
}
},
- "node_modules/defer-to-connect": {
- "version": "2.0.1",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/define-data-property": {
"version": "1.1.1",
"license": "MIT",
@@ -5344,13 +5155,6 @@
"node": ">= 0.8"
}
},
- "node_modules/end-of-stream": {
- "version": "1.4.4",
- "license": "MIT",
- "dependencies": {
- "once": "^1.4.0"
- }
- },
"node_modules/enhanced-resolve": {
"version": "5.15.0",
"license": "MIT",
@@ -5961,19 +5765,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/get-stream": {
- "version": "5.2.0",
- "license": "MIT",
- "dependencies": {
- "pump": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/glob": {
"version": "7.2.3",
"license": "ISC",
@@ -6059,29 +5850,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/got": {
- "version": "11.8.6",
- "license": "MIT",
- "dependencies": {
- "@sindresorhus/is": "^4.0.0",
- "@szmarczak/http-timer": "^4.0.5",
- "@types/cacheable-request": "^6.0.1",
- "@types/responselike": "^1.0.0",
- "cacheable-lookup": "^5.0.3",
- "cacheable-request": "^7.0.2",
- "decompress-response": "^6.0.0",
- "http2-wrapper": "^1.0.0-beta.5.2",
- "lowercase-keys": "^2.0.0",
- "p-cancelable": "^2.0.0",
- "responselike": "^2.0.0"
- },
- "engines": {
- "node": ">=10.19.0"
- },
- "funding": {
- "url": "https://github.com/sindresorhus/got?sponsor=1"
- }
- },
"node_modules/graceful-fs": {
"version": "4.2.11",
"license": "ISC"
@@ -6362,10 +6130,6 @@
"entities": "^2.0.0"
}
},
- "node_modules/http-cache-semantics": {
- "version": "4.1.1",
- "license": "BSD-2-Clause"
- },
"node_modules/http-deceiver": {
"version": "1.2.7",
"dev": true,
@@ -6427,17 +6191,6 @@
}
}
},
- "node_modules/http2-wrapper": {
- "version": "1.0.3",
- "license": "MIT",
- "dependencies": {
- "quick-lru": "^5.1.1",
- "resolve-alpn": "^1.0.0"
- },
- "engines": {
- "node": ">=10.19.0"
- }
- },
"node_modules/https-browserify": {
"version": "1.0.0",
"license": "MIT"
@@ -7116,10 +6869,6 @@
"node": ">=4"
}
},
- "node_modules/json-buffer": {
- "version": "3.0.1",
- "license": "MIT"
- },
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"license": "MIT"
@@ -7217,13 +6966,6 @@
"jquery": ">=1.5"
}
},
- "node_modules/keyv": {
- "version": "4.5.4",
- "license": "MIT",
- "dependencies": {
- "json-buffer": "3.0.1"
- }
- },
"node_modules/kind-of": {
"version": "6.0.3",
"dev": true,
@@ -7713,13 +7455,6 @@
"tslib": "^2.0.3"
}
},
- "node_modules/lowercase-keys": {
- "version": "2.0.0",
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/lru-cache": {
"version": "5.1.1",
"dev": true,
@@ -7798,14 +7533,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/merge-source-map": {
- "version": "1.1.0",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "source-map": "^0.6.1"
- }
- },
"node_modules/merge-stream": {
"version": "2.0.0",
"license": "MIT"
@@ -7887,13 +7614,6 @@
"node": ">=6"
}
},
- "node_modules/mimic-response": {
- "version": "1.0.1",
- "license": "MIT",
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/mini-css-extract-plugin": {
"version": "1.6.2",
"dev": true,
@@ -8146,6 +7866,7 @@
},
"node_modules/normalize-url": {
"version": "6.1.0",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=10"
@@ -8285,13 +8006,6 @@
"version": "0.3.0",
"license": "MIT"
},
- "node_modules/p-cancelable": {
- "version": "2.1.1",
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/p-limit": {
"version": "2.3.0",
"dev": true,
@@ -9103,21 +8817,6 @@
"version": "4.2.0",
"license": "MIT"
},
- "node_modules/prettier": {
- "version": "2.8.8",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "bin": {
- "prettier": "bin-prettier.js"
- },
- "engines": {
- "node": ">=10.13.0"
- },
- "funding": {
- "url": "https://github.com/prettier/prettier?sponsor=1"
- }
- },
"node_modules/pretty-time": {
"version": "1.1.0",
"dev": true,
@@ -9170,11 +8869,6 @@
"license": "MIT",
"optional": true
},
- "node_modules/pseudomap": {
- "version": "1.0.2",
- "dev": true,
- "license": "ISC"
- },
"node_modules/public-encrypt": {
"version": "4.0.3",
"license": "MIT",
@@ -9191,14 +8885,6 @@
"version": "4.12.0",
"license": "MIT"
},
- "node_modules/pump": {
- "version": "3.0.0",
- "license": "MIT",
- "dependencies": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
"node_modules/punycode": {
"version": "1.4.1",
"license": "MIT"
@@ -9240,16 +8926,6 @@
],
"license": "MIT"
},
- "node_modules/quick-lru": {
- "version": "5.1.1",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/raf": {
"version": "3.4.1",
"license": "MIT",
@@ -9530,10 +9206,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/resolve-alpn": {
- "version": "1.2.1",
- "license": "MIT"
- },
"node_modules/resolve-cwd": {
"version": "3.0.0",
"dev": true,
@@ -9561,16 +9233,6 @@
"node": ">=4"
}
},
- "node_modules/responselike": {
- "version": "2.0.1",
- "license": "MIT",
- "dependencies": {
- "lowercase-keys": "^2.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/restructure": {
"version": "2.0.1",
"license": "MIT"
@@ -10757,74 +10419,6 @@
"version": "1.1.2",
"license": "MIT"
},
- "node_modules/vue": {
- "version": "2.4.4",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/vue-hot-reload-api": {
- "version": "2.3.4",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/vue-loader": {
- "version": "15.10.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vue/component-compiler-utils": "^3.1.0",
- "hash-sum": "^1.0.2",
- "loader-utils": "^1.1.0",
- "vue-hot-reload-api": "^2.3.0",
- "vue-style-loader": "^4.1.0"
- },
- "peerDependencies": {
- "css-loader": "*",
- "webpack": "^3.0.0 || ^4.1.0 || ^5.0.0-0"
- },
- "peerDependenciesMeta": {
- "cache-loader": {
- "optional": true
- },
- "prettier": {
- "optional": true
- },
- "vue-template-compiler": {
- "optional": true
- }
- }
- },
- "node_modules/vue-loader/node_modules/json5": {
- "version": "1.0.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "minimist": "^1.2.0"
- },
- "bin": {
- "json5": "lib/cli.js"
- }
- },
- "node_modules/vue-loader/node_modules/loader-utils": {
- "version": "1.4.2",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "big.js": "^5.2.2",
- "emojis-list": "^3.0.0",
- "json5": "^1.0.1"
- },
- "engines": {
- "node": ">=4.0.0"
- }
- },
- "node_modules/vue-resource": {
- "version": "1.5.3",
- "license": "MIT",
- "dependencies": {
- "got": ">=8.0 <12.0"
- }
- },
"node_modules/vue-style-loader": {
"version": "4.1.3",
"dev": true,
@@ -10858,20 +10452,6 @@
"node": ">=4.0.0"
}
},
- "node_modules/vue-template-compiler": {
- "version": "2.4.4",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "de-indent": "^1.0.2",
- "he": "^1.1.0"
- }
- },
- "node_modules/vue-template-es2015-compiler": {
- "version": "1.9.1",
- "dev": true,
- "license": "MIT"
- },
"node_modules/watchpack": {
"version": "2.4.0",
"license": "MIT",
diff --git a/package.json b/package.json
index 93080aae4..54de82667 100644
--- a/package.json
+++ b/package.json
@@ -18,10 +18,7 @@
"jquery": "<3.6.0",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.20",
- "postcss": "^8.4.5",
- "vue": "2.4.4",
- "vue-loader": "^15.9.7",
- "vue-template-compiler": "2.4.4"
+ "postcss": "^8.4.5"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.4.2",
@@ -56,7 +53,6 @@
"sheetjs": "^2.0.0",
"tableexport.jquery.plugin": "1.28.0",
"tether": "^1.4.0",
- "vue-resource": "^1.5.2",
"webpack": "^5.89.0"
}
}
diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js
index cec13850d..0edde3675 100755
--- a/resources/assets/js/bootstrap.js
+++ b/resources/assets/js/bootstrap.js
@@ -19,28 +19,6 @@ jQuery.fn.uitooltip = jQuery.fn.tooltip;
*/
require('bootstrap-less');
-/**
- * Vue is a modern JavaScript library for building interactive web interfaces
- * using reactive data binding and reusable components. Vue's API is clean
- * and simple, leaving you to focus on building your next great project.
- */
-
-window.Vue = require('vue').default;
-window.eventHub = new Vue();
-require('vue-resource');
-
-/**
- * We'll register a HTTP interceptor to attach the "CSRF" header to each of
- * the outgoing requests issued by this application. The CSRF middleware
- * included with Laravel will automatically verify the header's value.
- */
-
-Vue.http.interceptors.push(function (request, next) {
- request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken);
-
- next();
-});
-
// require('admin-lte');
// require('chart.js');
diff --git a/resources/assets/js/components/passport/AuthorizedClients.vue b/resources/assets/js/components/passport/AuthorizedClients.vue
deleted file mode 100644
index f6bd92dbd..000000000
--- a/resources/assets/js/components/passport/AuthorizedClients.vue
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
- You have not created any OAuth clients.
- Authorized Applications
-
-
-
-
-
-
-
-
-
- Name
- Scopes
- Delete
-
-
-
-
-
- {{ token.client.name }}
-
-
-
-
-
- {{ token.scopes.join(', ') }}
-
-
-
-
-
-
- Revoke
-
-
-
- OAuth Clients
-
-
-
- Create New Client
-
-
-
-
-
-
-
-
-
- Client ID
- Name
- Secret
- Edit
- Delete
-
-
-
-
-
- {{ client.id }}
-
-
-
-
- {{ client.name }}
-
-
-
-
-
-
-
- {{ client.secret }}
-
-
- Edit
-
-
-
-
-
-
- Delete
-
-
-
Whoops! Something went wrong!
++ You have not created any OAuth clients. +
+ @endif + + @if($clients->count() > 0) +Client ID | +Name | +Secret | +Edit | +Delete | +
---|---|---|---|---|
+ {{ $client->id }} + | + + ++ {{ $client->name }} + | + + +
+ {{ $client->secret }}
+ |
+
+
+ + + Edit + + | + + ++ + + + | +
Name | +Scopes | +Delete | +
---|---|---|
+ {{ $token->client->name }} + | + + ++ @if(!$token->scopes) + No Scopes + @endif + | + + ++ + + + | +
{{ trans('general.feature_disabled') }}
@@ -24,9 +23,4 @@ @stop @section('moar_scripts') - @endsection diff --git a/resources/views/vendor/passport/authorize.blade.php b/resources/views/vendor/passport/authorize.blade.php index 8565c2d24..cdf328529 100644 --- a/resources/views/vendor/passport/authorize.blade.php +++ b/resources/views/vendor/passport/authorize.blade.php @@ -9,7 +9,7 @@