diff --git a/ProcessMaker/Http/Controllers/Auth/ClientController.php b/ProcessMaker/Http/Controllers/Auth/ClientController.php
index f77930c7e2..780fbe81dd 100644
--- a/ProcessMaker/Http/Controllers/Auth/ClientController.php
+++ b/ProcessMaker/Http/Controllers/Auth/ClientController.php
@@ -65,7 +65,6 @@ public function store(Request $request)
);
}
- $client->makeVisible('secret');
AuthClientCreated::dispatch($client->getAttributes());
return new AuthClientResource($client);
diff --git a/ProcessMaker/Http/Resources/AuthClient.php b/ProcessMaker/Http/Resources/AuthClient.php
index a9681fb083..271c106a5a 100644
--- a/ProcessMaker/Http/Resources/AuthClient.php
+++ b/ProcessMaker/Http/Resources/AuthClient.php
@@ -26,7 +26,7 @@ public function toArray($request)
return [
'id' => $this->id,
'name' => $this->name,
- 'secret' => $this->secret,
+ 'secret' => $this->plainSecret,
'redirect' => $this->redirect,
'revoked' => $this->revoked,
'types' => $types,
diff --git a/resources/js/admin/auth-clients/components/AuthClientsListing.vue b/resources/js/admin/auth-clients/components/AuthClientsListing.vue
index 24a5f29baf..6b55bcfa32 100644
--- a/resources/js/admin/auth-clients/components/AuthClientsListing.vue
+++ b/resources/js/admin/auth-clients/components/AuthClientsListing.vue
@@ -33,19 +33,6 @@
:divider="true"
/>
-
-
-
-
- {{ props.rowData.secret.substr(0, 10) }}...
-
-
@@ -73,7 +59,6 @@ export default {
props: ["filter", "permission"],
data() {
return {
- copytext: "",
sortOrder: [
{
field: "name",
@@ -101,10 +86,6 @@ export default {
return val.substr(0, 20) + "...";
},
},
- {
- title: () => this.$t("Client Secret"),
- name: "__slot:secret",
- },
{
name: "__slot:actions",
title: "",
@@ -129,8 +110,7 @@ export default {
data = data.filter((item) => {
return (
item.name.toLowerCase().indexOf(this.filter.toLowerCase()) > -1 ||
- item.redirect.toLowerCase().indexOf(this.filter.toLowerCase()) > -1 ||
- item.secret.toLowerCase().indexOf(this.filter.toLowerCase()) > -1
+ item.redirect.toLowerCase().indexOf(this.filter.toLowerCase()) > -1
);
});
}
@@ -184,11 +164,6 @@ export default {
}
this.fetch();
},
- copySecret(secret) {
- this.$refs.copytext.value = secret;
- this.$refs.copytext.select();
- document.execCommand("copy");
- },
onNavigate(action, data) {
switch (action.value) {
case 'edit-item':
@@ -223,15 +198,3 @@ export default {
},
};
-
-
diff --git a/resources/lang/en.json b/resources/lang/en.json
index bbe4bc36dd..0161aa01bc 100644
--- a/resources/lang/en.json
+++ b/resources/lang/en.json
@@ -474,6 +474,7 @@
"Copy Control": "Copy Control",
"Copy Element": "Copy Element",
"Copy link": "Copy link",
+ "Copy Secret To Clipboard": "Copy Secret To Clipboard",
"Copy Screen": "Copy Screen",
"Copy Script": "Copy Script",
"Copy this URL into your Atlassian authorization settings": "Copy this URL into your Atlassian authorization settings",
@@ -498,6 +499,7 @@
"Create an Inbox Rule Now": "Create an Inbox Rule Now",
"Create Auth Clients": "Create Auth Clients",
"Create AuthClients": "Create Auth-Clients",
+ "Create Auth-Client": "Create Auth-Client",
"Create Bundle": "Create Bundle",
"Create Categories": "Create Categories",
"Create Category": "Create Category",
@@ -2355,6 +2357,7 @@
"This file is password protected. Enter the password below to continue with the import.": "This file is password protected. Enter the password below to continue with the import.",
"This is a Beta version and when using Quickfill, it may replace the pre-filled information in the form.": "This is a Beta version and when using Quickfill, it may replace the pre-filled information in the form.",
"This is an AI feature and can provide inaccurate or biased responses.": "This is an AI feature and can provide inaccurate or biased responses.",
+ "This is the only time you will be able to view the client secret. Keep it in a safe place.": "This is the only time you will be able to view the client secret. Keep it in a safe place.",
"This is your security code: :code": "This is your security code: :code",
"This may cause validation errors during submission.": "This may cause validation errors during submission.",
"This must be valid JSON": "This must be valid JSON",
diff --git a/resources/lang/es.json b/resources/lang/es.json
index 5f954b5061..cb2e96816f 100644
--- a/resources/lang/es.json
+++ b/resources/lang/es.json
@@ -455,6 +455,7 @@
"Copy Control": "Control de copia",
"Copy Element": "Copiar elemento",
"Copy link": "Copiar enlace",
+ "Copy Secret To Clipboard": "Copiar secreto al portapapeles",
"Copy Screen": "Copiar pantalla",
"Copy Script": "Copiar script",
"Copy this URL into your Atlassian authorization settings": "Copie esta URL en su configuración de autorización de Atlassian",
@@ -474,6 +475,7 @@
"Create a new Process": "Crea un nuevo Proceso",
"Create a Project": "Crea un Proyecto",
"Create An Auth-Client": "Crear un cliente autenticado",
+ "Create Auth-Client": "Crear cliente autenticado",
"Create an Inbox Rule Now": "Crea una Regla de Bandeja de Entrada Ahora",
"Create Auth Clients": "Crear clientes de autenticación",
"Create AuthClients": "Crear clientes autenticados",
@@ -2293,6 +2295,7 @@
"This file is password protected. Enter the password below to continue with the import.": "Este archivo está protegido con contraseña. Ingrese la contraseña a continuación para continuar con la importación.",
"This is a Beta version and when using Quickfill, it may replace the pre-filled information in the form.": "Esta es una versión Beta y al usar Quickfill, puede reemplazar la información previamente llenada en el formulario.",
"This is an AI feature and can provide inaccurate or biased responses.": "Esta es una función de IA y puede proporcionar respuestas inexactas o sesgadas.",
+ "This is the only time you will be able to view the client secret. Keep it in a safe place.": "Esta es la única vez que podrás ver el secreto del cliente. Manténgalo en un lugar seguro.",
"This is your security code: :code": "This is your security code: :code",
"This may cause validation errors during submission.": "Esto puede causar errores de validación durante la presentación.",
"This must be valid JSON": "Este debe ser un JSON válido",
diff --git a/resources/views/admin/auth-clients/index.blade.php b/resources/views/admin/auth-clients/index.blade.php
index fabf5a8d54..d306571ee3 100644
--- a/resources/views/admin/auth-clients/index.blade.php
+++ b/resources/views/admin/auth-clients/index.blade.php
@@ -40,6 +40,26 @@
+
+
+
+
+
{{ __('This is the only time you will be able to view the client secret. Keep it in a safe place.') }}
+
+
-
@endsection
@@ -88,8 +107,12 @@
errors: null,
disabled: false,
title:'',
+ secretTitle:'',
+ customModalButtons: [],
+ secret: "",
},
beforeMount() {
+ this.initCustomModalButtons();
this.resetValues();
},
methods: {
@@ -120,8 +143,14 @@
data: this.authClient,
}).then(response => {
this.$refs.createEditAuthClient.hide();
- this.$refs.authClientList.fetch();
this.loading = false;
+ if (response.data.secret) {
+ this.secret = response.data.secret
+ this.$refs.secretModal.show();
+ }
+ else {
+ this.$refs.authClientList.fetch();
+ }
ProcessMaker.alert(this.$t("The auth client was ") + verb + ".", this.$t("success"))
}).catch(error => {
this.disabled = false;
@@ -130,6 +159,7 @@
},
resetValues() {
this.title = this.$t('Create Auth-Client')
+ this.secretTitle = this.$t('Copy Secret To Clipboard')
this.authClient = {
id: null,
name: "",
@@ -143,12 +173,35 @@
types: null
};
this.disabled = false;
+ this.initCustomModalButtons();
},
edit(item) {
this.title = this.$t('Edit Auth Client');
this.authClient = item;
this.$refs.createEditAuthClient.show();
- }
+ },
+ initCustomModalButtons() {
+ this.customModalButtons = [
+ {
+ content: "Close",
+ action: "close",
+ variant: "secondary",
+ disabled: false,
+ hidden: false,
+ },
+ ];
+ },
+ hideSecretModal() {
+ this.$refs.secretModal.hide();
+ this.$refs.authClientList.fetch();
+ },
+ copySecret(secret) {
+ navigator.clipboard.writeText(secret).then(() => {
+ ProcessMaker.alert(this.$t("Secret copied to clipboard."), "success");
+ }, () => {
+ ProcessMaker.alert(this.$t("Secret not copied to clipboard."), "danger");
+ });
+ },
},
})