@luizleon/sf.prefeiturasp.vuecomponents 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.es.js +1999 -1806
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +14 -12
- package/dist/lib.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/keycloak.js +17 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luizleon/sf.prefeiturasp.vuecomponents",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/lib.umd.js",
|
|
6
6
|
"module": "dist/lib.es.js",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@vitejs/plugin-vue": "4.4.1",
|
|
20
20
|
"base64-js": "1.5.1",
|
|
21
21
|
"dompurify": "3.0.6",
|
|
22
|
+
"dotenv": "16.3.1",
|
|
22
23
|
"js-sha256": "0.10.1",
|
|
23
24
|
"jwt-decode": "4.0.0",
|
|
24
25
|
"rimraf": "3.0.2",
|
package/src/keycloak.js
CHANGED
|
@@ -23,12 +23,17 @@
|
|
|
23
23
|
*
|
|
24
24
|
* Adaptado para expor setToken.
|
|
25
25
|
*
|
|
26
|
-
* Adpatado
|
|
26
|
+
* Adpatado para usar URL absoluta em configUrl (linha 829).
|
|
27
|
+
*
|
|
28
|
+
* Adaptado para usar dotenv.
|
|
27
29
|
*/
|
|
28
30
|
|
|
29
31
|
import base64 from 'base64-js';
|
|
30
32
|
import sha256 from 'js-sha256';
|
|
31
33
|
import { jwtDecode } from 'jwt-decode';
|
|
34
|
+
import * as dotenv from "dotenv";
|
|
35
|
+
|
|
36
|
+
dotenv.config();
|
|
32
37
|
|
|
33
38
|
if (typeof Promise === 'undefined') {
|
|
34
39
|
throw Error('Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.');
|
|
@@ -825,11 +830,17 @@ function Keycloak (config) {
|
|
|
825
830
|
var promise = createPromise();
|
|
826
831
|
var configUrl;
|
|
827
832
|
|
|
828
|
-
if (!config) {
|
|
829
|
-
|
|
830
|
-
} else if (typeof config === 'string') {
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
+
// if (!config) {
|
|
834
|
+
// configUrl = location.origin + '/keycloak.json';
|
|
835
|
+
// } else if (typeof config === 'string') {
|
|
836
|
+
// configUrl = config;
|
|
837
|
+
// }
|
|
838
|
+
|
|
839
|
+
// Alterado para usar dotenv
|
|
840
|
+
|
|
841
|
+
kc.authServerUrl = process.env.AUTHSERVICE_URL;
|
|
842
|
+
kc.realm = process.env.AUTHSERVICE_REALM;
|
|
843
|
+
kc.clientId = process.env.AUTHSERVICE_CLIENTID;
|
|
833
844
|
|
|
834
845
|
function setupOidcEndoints(oidcConfiguration) {
|
|
835
846
|
if (! oidcConfiguration) {
|