@archbase/security 4.3.0 → 4.3.2
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/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
2
|
import * as I from "inversify";
|
|
3
|
-
import { decorate as
|
|
4
|
-
import { compressString as
|
|
5
|
-
import
|
|
6
|
-
import { jwtDecode as
|
|
3
|
+
import { decorate as Lt, injectable as Ot } from "inversify";
|
|
4
|
+
import { compressString as zt, decompressString as jt, IOCContainer as Ft, ARCHBASE_IOC_API_TYPE as q, processErrorMessage as oe, IsNotEmpty as Q, IsOptional as Z, IsBoolean as se, IsEmail as Ht, getKeyByEnumValue as et, useArchbasePasswordRemember as Vt, getI18nextInstance as S, useArchbaseTheme as Wt, resolveArchbasePasswordPolicy as Gt, isEmailValidate as Jt, validateArchbasePassword as Kt, useArchbaseAppContext as qt } from "@archbase/core";
|
|
5
|
+
import K from "crypto-js";
|
|
6
|
+
import { jwtDecode as Yt } from "jwt-decode";
|
|
7
7
|
import { jsx as o, jsxs as C, Fragment as ie } from "react/jsx-runtime";
|
|
8
|
-
import
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import { ArchbaseRemoteApiService as
|
|
11
|
-
import { v4 as
|
|
12
|
-
import { Card as
|
|
13
|
-
import { useFocusTrap as
|
|
14
|
-
import { IconCopy as
|
|
15
|
-
import { ArchbaseQRCode as
|
|
16
|
-
import { useContainer as
|
|
17
|
-
class
|
|
8
|
+
import ct, { useState as p, useEffect as Y, createContext as Ve, useMemo as lt, useRef as We, useCallback as Ce, useContext as Ge } from "react";
|
|
9
|
+
import { BehaviorSubject as tt } from "rxjs";
|
|
10
|
+
import { ArchbaseRemoteApiService as ye, useArchbaseStore as dt } from "@archbase/data";
|
|
11
|
+
import { v4 as ee } from "uuid";
|
|
12
|
+
import { Card as Je, Text as j, Divider as De, Stack as xe, TextInput as Se, Button as W, Anchor as rt, Group as ue, Select as Xt, Tooltip as Qt, Loader as ut, PasswordInput as je, Checkbox as Zt, Alert as st, Code as nt, CopyButton as ot, SimpleGrid as er, useMantineColorScheme as tr, Box as rr, Skeleton as Pe } from "@mantine/core";
|
|
13
|
+
import { useFocusTrap as ht } from "@mantine/hooks";
|
|
14
|
+
import { IconCopy as sr } from "@tabler/icons-react";
|
|
15
|
+
import { ArchbaseQRCode as nr, ArchbasePasswordStrengthMeter as or, ArchbaseDialog as it } from "@archbase/components";
|
|
16
|
+
import { useContainer as _e } from "inversify-react";
|
|
17
|
+
class pt {
|
|
18
18
|
id;
|
|
19
19
|
displayName;
|
|
20
20
|
email;
|
|
@@ -24,10 +24,10 @@ class ht {
|
|
|
24
24
|
this.id = e.id, this.displayName = e.displayName, this.email = e.email, this.photo = e.photo, this.isAdmin = e.isAdmin;
|
|
25
25
|
}
|
|
26
26
|
static newInstance() {
|
|
27
|
-
return new
|
|
27
|
+
return new pt({});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class ft {
|
|
31
31
|
username;
|
|
32
32
|
password;
|
|
33
33
|
remember;
|
|
@@ -35,16 +35,16 @@ class pt {
|
|
|
35
35
|
this.username = e.username, this.password = e.password, this.remember = e.remember;
|
|
36
36
|
}
|
|
37
37
|
static newInstance() {
|
|
38
|
-
return new
|
|
38
|
+
return new ft({});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const le = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=",
|
|
42
|
-
class
|
|
41
|
+
const le = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=", $e = "c1ab58e7-c113-4225-a190-a9e59d1207fc", Be = "6faf6932-a0b5-457b-83b1-8d89ddbd91fd", Le = "602b05c5-ec46-451e-aba6-187e463bc245", Oe = "8b4a7c2d-9e5f-4163-b8a7-3f2c9d8e5a1b";
|
|
42
|
+
class ir {
|
|
43
43
|
getUsernameAndPassword() {
|
|
44
44
|
try {
|
|
45
|
-
const e = localStorage.getItem(
|
|
45
|
+
const e = localStorage.getItem(Be);
|
|
46
46
|
if (e) {
|
|
47
|
-
const t =
|
|
47
|
+
const t = K.AES.decrypt(e, le).toString(K.enc.Utf8), n = atob(t).split(":");
|
|
48
48
|
return { username: n[0], password: n[1], remember: !0 };
|
|
49
49
|
} else
|
|
50
50
|
return null;
|
|
@@ -53,14 +53,14 @@ class or {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
saveUsernameAndPassword(e, t) {
|
|
56
|
-
const s = btoa(`${e}:${t}`), n =
|
|
57
|
-
localStorage.setItem(
|
|
56
|
+
const s = btoa(`${e}:${t}`), n = K.AES.encrypt(s, le).toString();
|
|
57
|
+
localStorage.setItem(Be, n);
|
|
58
58
|
}
|
|
59
59
|
getUsername() {
|
|
60
60
|
try {
|
|
61
|
-
const e = localStorage.getItem(
|
|
61
|
+
const e = localStorage.getItem(Le);
|
|
62
62
|
if (e) {
|
|
63
|
-
const t =
|
|
63
|
+
const t = K.AES.decrypt(e, le).toString(K.enc.Utf8);
|
|
64
64
|
return atob(t);
|
|
65
65
|
} else
|
|
66
66
|
return null;
|
|
@@ -69,42 +69,42 @@ class or {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
saveUsername(e) {
|
|
72
|
-
const t = btoa(e), s =
|
|
73
|
-
localStorage.setItem(
|
|
72
|
+
const t = btoa(e), s = K.AES.encrypt(t, le).toString();
|
|
73
|
+
localStorage.setItem(Le, s);
|
|
74
74
|
}
|
|
75
75
|
isTokenExpired(e, t = 300) {
|
|
76
76
|
let s = e;
|
|
77
77
|
if (!s && !this.getToken())
|
|
78
78
|
return !0;
|
|
79
79
|
try {
|
|
80
|
-
const n =
|
|
80
|
+
const n = Yt(s.access_token);
|
|
81
81
|
if (!n)
|
|
82
82
|
return !0;
|
|
83
|
-
const
|
|
84
|
-
return
|
|
83
|
+
const c = Math.floor(Date.now() / 1e3), l = n.exp;
|
|
84
|
+
return c > l - t;
|
|
85
85
|
} catch {
|
|
86
86
|
return !0;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
saveToken(e) {
|
|
90
90
|
if (e) {
|
|
91
|
-
const t = JSON.stringify(e), s =
|
|
92
|
-
localStorage.setItem(
|
|
91
|
+
const t = JSON.stringify(e), s = K.AES.encrypt(t, le).toString(), n = zt(s);
|
|
92
|
+
localStorage.setItem($e, n);
|
|
93
93
|
} else
|
|
94
94
|
this.clearToken();
|
|
95
95
|
}
|
|
96
96
|
clearUsernameAndPassword() {
|
|
97
|
-
localStorage.removeItem(
|
|
97
|
+
localStorage.removeItem(Be), localStorage.removeItem(Le);
|
|
98
98
|
}
|
|
99
99
|
clearToken() {
|
|
100
|
-
localStorage.removeItem(
|
|
100
|
+
localStorage.removeItem($e);
|
|
101
101
|
}
|
|
102
102
|
getToken() {
|
|
103
103
|
try {
|
|
104
|
-
const e = localStorage.getItem(
|
|
104
|
+
const e = localStorage.getItem($e);
|
|
105
105
|
if (!e)
|
|
106
106
|
return null;
|
|
107
|
-
const t =
|
|
107
|
+
const t = jt(e), s = K.AES.decrypt(t, le).toString(K.enc.Utf8);
|
|
108
108
|
return JSON.parse(s);
|
|
109
109
|
} catch {
|
|
110
110
|
return null;
|
|
@@ -112,37 +112,37 @@ class or {
|
|
|
112
112
|
}
|
|
113
113
|
saveContext(e) {
|
|
114
114
|
try {
|
|
115
|
-
const t =
|
|
116
|
-
localStorage.setItem(
|
|
115
|
+
const t = K.AES.encrypt(e, le).toString();
|
|
116
|
+
localStorage.setItem(Oe, t);
|
|
117
117
|
} catch (t) {
|
|
118
118
|
console.warn("Erro ao salvar contexto:", t);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
getContext() {
|
|
122
122
|
try {
|
|
123
|
-
const e = localStorage.getItem(
|
|
124
|
-
return e ?
|
|
123
|
+
const e = localStorage.getItem(Oe);
|
|
124
|
+
return e ? K.AES.decrypt(e, le).toString(K.enc.Utf8) : null;
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
clearContext() {
|
|
130
|
-
localStorage.removeItem(
|
|
130
|
+
localStorage.removeItem(Oe);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
function
|
|
133
|
+
Lt(Ot(), ir);
|
|
134
|
+
function mt(r) {
|
|
135
135
|
const t = new Uint8Array(1);
|
|
136
|
-
return window.crypto.getRandomValues(t), t[0] >= Math.floor(256 / r) * r ?
|
|
136
|
+
return window.crypto.getRandomValues(t), t[0] >= Math.floor(256 / r) * r ? mt(r) : t[0] % r;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function ar(r) {
|
|
139
139
|
let e = "";
|
|
140
140
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
141
141
|
for (let s = 0; s < r; s++)
|
|
142
|
-
e += t.charAt(
|
|
142
|
+
e += t.charAt(mt(t.length - 1));
|
|
143
143
|
return e;
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
145
|
+
async function cr(r) {
|
|
146
146
|
if (!window.crypto.subtle?.digest)
|
|
147
147
|
throw new Error(
|
|
148
148
|
"The context/environment is not secure, and does not support the 'crypto.subtle' module. See: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle for details"
|
|
@@ -150,36 +150,36 @@ async function ar(r) {
|
|
|
150
150
|
const t = new TextEncoder().encode(r), s = await window.crypto.subtle.digest("SHA-256", t), n = String.fromCharCode(...new Uint8Array(s));
|
|
151
151
|
return btoa(n).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class gt extends Error {
|
|
154
154
|
status;
|
|
155
155
|
statusText;
|
|
156
156
|
constructor(e, t, s) {
|
|
157
157
|
super(s), this.name = "FetchError", this.status = e, this.statusText = t;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function lr(r) {
|
|
161
161
|
let e = "";
|
|
162
162
|
return Object.entries(r).forEach(([t, s]) => {
|
|
163
163
|
e += (e ? "&" : "") + t + "=" + encodeURIComponent(s);
|
|
164
164
|
}), e;
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
166
|
+
async function dr(r, e) {
|
|
167
167
|
return fetch(r, {
|
|
168
168
|
method: "POST",
|
|
169
|
-
body:
|
|
169
|
+
body: lr(e),
|
|
170
170
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
171
171
|
}).then(async (t) => {
|
|
172
172
|
if (!t.ok) {
|
|
173
173
|
const s = await t.text();
|
|
174
|
-
throw new
|
|
174
|
+
throw new gt(t.status, t.statusText, s);
|
|
175
175
|
}
|
|
176
176
|
return t;
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
async function
|
|
181
|
-
const t =
|
|
182
|
-
return sessionStorage.setItem(
|
|
179
|
+
const yt = "PKCE_code_verifier", Fe = "ROCP_auth_state";
|
|
180
|
+
async function ur(r, e) {
|
|
181
|
+
const t = ar(96);
|
|
182
|
+
return sessionStorage.setItem(yt, t), cr(t).then((s) => {
|
|
183
183
|
const n = new URLSearchParams({
|
|
184
184
|
response_type: "code",
|
|
185
185
|
client_id: r.clientId,
|
|
@@ -188,23 +188,23 @@ async function dr(r, e) {
|
|
|
188
188
|
code_challenge_method: "S256",
|
|
189
189
|
...r.extraAuthParameters
|
|
190
190
|
});
|
|
191
|
-
r.scope !== void 0 && n.append("scope", r.scope), sessionStorage.removeItem(
|
|
192
|
-
const
|
|
193
|
-
|
|
191
|
+
r.scope !== void 0 && n.append("scope", r.scope), sessionStorage.removeItem(Fe);
|
|
192
|
+
const c = e ?? r.state;
|
|
193
|
+
c && (sessionStorage.setItem(Fe, c), n.append("state", c)), r?.preLogin && r.preLogin(), window.location.replace(`${r.authorizationEndpoint}?${n.toString()}`);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function hr(r) {
|
|
197
197
|
return r.access_token !== void 0;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
201
|
-
if (
|
|
199
|
+
function vt(r, e) {
|
|
200
|
+
return dr(r, e).then((t) => t.json().then((s) => {
|
|
201
|
+
if (hr(s))
|
|
202
202
|
return s;
|
|
203
203
|
throw Error(s);
|
|
204
204
|
}));
|
|
205
205
|
}
|
|
206
|
-
const
|
|
207
|
-
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(
|
|
206
|
+
const pr = (r) => {
|
|
207
|
+
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(yt);
|
|
208
208
|
if (!t)
|
|
209
209
|
throw Error(`Parâmetro 'código' não encontrado na URL.
|
|
210
210
|
A autenticação ocorreu?`);
|
|
@@ -221,8 +221,8 @@ A autenticação ocorreu?`);
|
|
|
221
221
|
...r.extraTokenParameters,
|
|
222
222
|
...r.extraAuthParams
|
|
223
223
|
};
|
|
224
|
-
return
|
|
225
|
-
},
|
|
224
|
+
return vt(r.tokenEndpoint, n);
|
|
225
|
+
}, fr = (r) => {
|
|
226
226
|
const { config: e, refreshToken: t } = r, s = {
|
|
227
227
|
grant_type: "refresh_token",
|
|
228
228
|
refresh_token: t,
|
|
@@ -231,10 +231,10 @@ A autenticação ocorreu?`);
|
|
|
231
231
|
redirect_uri: e.redirectUri,
|
|
232
232
|
...e.extraTokenParameters
|
|
233
233
|
};
|
|
234
|
-
return
|
|
234
|
+
return vt(e.tokenEndpoint, s);
|
|
235
235
|
};
|
|
236
|
-
function
|
|
237
|
-
const
|
|
236
|
+
function mr(r, e, t, s, n, c) {
|
|
237
|
+
const l = new URLSearchParams({
|
|
238
238
|
token: t || e,
|
|
239
239
|
token_type_hint: t ? "refresh_token" : "access_token",
|
|
240
240
|
client_id: r.clientId,
|
|
@@ -242,17 +242,17 @@ function fr(r, e, t, s, n, a) {
|
|
|
242
242
|
ui_locales: window.navigator.languages.reduce((i, d) => i + " " + d),
|
|
243
243
|
...r.extraLogoutParameters
|
|
244
244
|
});
|
|
245
|
-
s &&
|
|
245
|
+
s && l.append("id_token_hint", s), n && l.append("state", n), c && l.append("logout_hint", c), window.location.replace(`${r.logoutEndpoint}?${l.toString()}`);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const e = r.get("state"), t = sessionStorage.getItem(
|
|
247
|
+
function gr(r) {
|
|
248
|
+
const e = r.get("state"), t = sessionStorage.getItem(Fe);
|
|
249
249
|
if (e !== t)
|
|
250
250
|
throw new Error(
|
|
251
251
|
'"state" valor recebido do servidor de autenticação não corresponde à solicitação do cliente. Possível falsificação de solicitação entre sites'
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
function de(r, e, t) {
|
|
255
|
-
const s = t === "session" ? sessionStorage : localStorage, [n,
|
|
255
|
+
const s = t === "session" ? sessionStorage : localStorage, [n, c] = p(() => {
|
|
256
256
|
const i = s.getItem(r);
|
|
257
257
|
try {
|
|
258
258
|
return i ? JSON.parse(i) : e;
|
|
@@ -263,69 +263,69 @@ Continuando com o valor padrão.
|
|
|
263
263
|
Error: ${d.message}`
|
|
264
264
|
), e;
|
|
265
265
|
}
|
|
266
|
-
}),
|
|
266
|
+
}), l = (i) => {
|
|
267
267
|
if (i === void 0) {
|
|
268
|
-
|
|
268
|
+
c(i), s.removeItem(r);
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
try {
|
|
272
272
|
const d = i instanceof Function ? i(n) : i;
|
|
273
|
-
|
|
273
|
+
c(d), s.setItem(r, JSON.stringify(d));
|
|
274
274
|
} catch {
|
|
275
275
|
console.log(`Falha ao armazenar valor '${i}' para chave '${r}'`);
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
|
-
return
|
|
278
|
+
return Y(() => {
|
|
279
279
|
const i = (d) => {
|
|
280
|
-
d.storageArea === s && d.key === r &&
|
|
280
|
+
d.storageArea === s && d.key === r && c(JSON.parse(d.newValue ?? ""));
|
|
281
281
|
};
|
|
282
282
|
return window.addEventListener("storage", i, !1), () => window.removeEventListener("storage", i, !1);
|
|
283
|
-
}), [n,
|
|
283
|
+
}), [n, l];
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
286
286
|
__proto__: null,
|
|
287
287
|
default: de
|
|
288
288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
289
|
-
function
|
|
289
|
+
function Te(r) {
|
|
290
290
|
return ["", void 0, null].includes(r);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function yr(r) {
|
|
293
293
|
const {
|
|
294
294
|
autoLogin: e = !0,
|
|
295
295
|
clearURL: t = !0,
|
|
296
296
|
decodeToken: s = !0,
|
|
297
297
|
scope: n = void 0,
|
|
298
|
-
preLogin:
|
|
299
|
-
postLogin:
|
|
298
|
+
preLogin: c = () => null,
|
|
299
|
+
postLogin: l = () => null,
|
|
300
300
|
onRefreshTokenExpire: i = void 0,
|
|
301
301
|
storage: d = "local"
|
|
302
|
-
} = r,
|
|
302
|
+
} = r, g = {
|
|
303
303
|
...r,
|
|
304
304
|
autoLogin: e,
|
|
305
305
|
clearURL: t,
|
|
306
306
|
decodeToken: s,
|
|
307
307
|
scope: n,
|
|
308
|
-
preLogin:
|
|
309
|
-
postLogin:
|
|
308
|
+
preLogin: c,
|
|
309
|
+
postLogin: l,
|
|
310
310
|
onRefreshTokenExpire: i,
|
|
311
311
|
storage: d
|
|
312
312
|
};
|
|
313
|
-
return
|
|
313
|
+
return vr(g), g;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
if (
|
|
315
|
+
function vr(r) {
|
|
316
|
+
if (Te(r?.clientId))
|
|
317
317
|
throw Error(
|
|
318
318
|
"'clientId' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
319
319
|
);
|
|
320
|
-
if (
|
|
320
|
+
if (Te(r?.authorizationEndpoint))
|
|
321
321
|
throw Error(
|
|
322
322
|
"'authorizationEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
323
323
|
);
|
|
324
|
-
if (
|
|
324
|
+
if (Te(r?.tokenEndpoint))
|
|
325
325
|
throw Error(
|
|
326
326
|
"'tokenEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
327
327
|
);
|
|
328
|
-
if (
|
|
328
|
+
if (Te(r?.redirectUri))
|
|
329
329
|
throw Error(
|
|
330
330
|
"'redirectUri' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
331
331
|
);
|
|
@@ -337,23 +337,23 @@ function yr(r) {
|
|
|
337
337
|
"Usar 'extraAuthParams' e 'extraTokenParameters' não é recomendado. Eles fazem a mesma coisa e você deve usar apenas 'extraTokenParameters'"
|
|
338
338
|
);
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
function
|
|
340
|
+
const me = 600, fe = (r) => Math.round(Date.now() / 1e3 + r);
|
|
341
|
+
function at(r) {
|
|
342
342
|
return Math.round(Date.now()) / 1e3 + 30 >= r;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
344
|
+
const wr = [
|
|
345
345
|
"refresh_expires_in",
|
|
346
346
|
// KeyCloak
|
|
347
347
|
"refresh_token_expires_in"
|
|
348
348
|
// Azure AD
|
|
349
349
|
];
|
|
350
|
-
function
|
|
351
|
-
for (const t of
|
|
350
|
+
function br(r, e) {
|
|
351
|
+
for (const t of wr)
|
|
352
352
|
if (t in e)
|
|
353
353
|
return e[t];
|
|
354
|
-
return e.refresh_token ? r +
|
|
354
|
+
return e.refresh_token ? r + me : r;
|
|
355
355
|
}
|
|
356
|
-
const
|
|
356
|
+
const Ue = (r) => {
|
|
357
357
|
try {
|
|
358
358
|
const t = r.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), s = decodeURIComponent(
|
|
359
359
|
atob(t).split("").map(function(n) {
|
|
@@ -368,30 +368,30 @@ const Te = (r) => {
|
|
|
368
368
|
Você pode desativar a decodificação JWT definindo o valor 'decodeToken' como 'falso' na configuração.`
|
|
369
369
|
);
|
|
370
370
|
}
|
|
371
|
-
},
|
|
371
|
+
}, Ar = Ve({
|
|
372
372
|
token: "",
|
|
373
373
|
login: () => null,
|
|
374
374
|
logOut: () => null,
|
|
375
375
|
error: null,
|
|
376
376
|
loginInProgress: !1
|
|
377
|
-
}),
|
|
378
|
-
const t =
|
|
377
|
+
}), Jr = ({ authConfig: r, children: e }) => {
|
|
378
|
+
const t = lt(() => yr(r), [r]), [s, n] = de(
|
|
379
379
|
"ROCP_refreshToken",
|
|
380
380
|
void 0,
|
|
381
381
|
t.storage
|
|
382
|
-
), [
|
|
382
|
+
), [c, l] = de(
|
|
383
383
|
"ROCP_refreshTokenExpire",
|
|
384
|
-
|
|
384
|
+
fe(2 * me),
|
|
385
385
|
t.storage
|
|
386
|
-
), [i, d] = de("ROCP_token", "", t.storage), [
|
|
386
|
+
), [i, d] = de("ROCP_token", "", t.storage), [g, k] = de(
|
|
387
387
|
"ROCP_tokenExpire",
|
|
388
|
-
|
|
388
|
+
fe(me),
|
|
389
389
|
t.storage
|
|
390
|
-
), [
|
|
390
|
+
), [u, T] = de(
|
|
391
391
|
"ROCP_idToken",
|
|
392
392
|
void 0,
|
|
393
393
|
t.storage
|
|
394
|
-
), [
|
|
394
|
+
), [b, v] = de(
|
|
395
395
|
"ROCP_loginInProgress",
|
|
396
396
|
!1,
|
|
397
397
|
t.storage
|
|
@@ -399,55 +399,55 @@ const Te = (r) => {
|
|
|
399
399
|
"ROCP_refreshInProgress",
|
|
400
400
|
!1,
|
|
401
401
|
t.storage
|
|
402
|
-
), [M, B] = p(), [
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
n(void 0), d(""), k(
|
|
406
|
-
}
|
|
407
|
-
function L(
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
function N(
|
|
411
|
-
|
|
412
|
-
let
|
|
413
|
-
|
|
414
|
-
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${
|
|
415
|
-
),
|
|
416
|
-
console.error(
|
|
402
|
+
), [M, B] = p(), [F, D] = p(), [w, f] = p(null);
|
|
403
|
+
let _;
|
|
404
|
+
function H() {
|
|
405
|
+
n(void 0), d(""), k(fe(me)), l(fe(me)), T(void 0), B(void 0), D(void 0), v(!1);
|
|
406
|
+
}
|
|
407
|
+
function L(m, y) {
|
|
408
|
+
H(), f(null), t?.logoutEndpoint && mr(t, i, s, u, m, y);
|
|
409
|
+
}
|
|
410
|
+
function N(m) {
|
|
411
|
+
H(), v(!0);
|
|
412
|
+
let y = m;
|
|
413
|
+
m && typeof m != "string" && (console.warn(
|
|
414
|
+
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${m}'. Ignorando o valor...`
|
|
415
|
+
), y = void 0), ur(t, y).catch((J) => {
|
|
416
|
+
console.error(J), f(J.message), v(!1);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
d(
|
|
421
|
-
const
|
|
422
|
-
k(
|
|
423
|
-
const
|
|
424
|
-
|
|
419
|
+
function X(m) {
|
|
420
|
+
d(m.access_token), n(m.refresh_token);
|
|
421
|
+
const y = t.tokenExpiresIn ?? m.expires_in ?? me;
|
|
422
|
+
k(fe(y));
|
|
423
|
+
const J = t.refreshTokenExpiresIn ?? br(y, m);
|
|
424
|
+
l(fe(J)), T(m.id_token);
|
|
425
425
|
try {
|
|
426
|
-
|
|
427
|
-
} catch (
|
|
428
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
426
|
+
m.id_token && D(Ue(m.id_token));
|
|
427
|
+
} catch (V) {
|
|
428
|
+
console.warn(`Falha ao decodificar idToken: ${V.message}`);
|
|
429
429
|
}
|
|
430
430
|
try {
|
|
431
|
-
t.decodeToken && B(
|
|
432
|
-
} catch (
|
|
433
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
431
|
+
t.decodeToken && B(Ue(m.access_token));
|
|
432
|
+
} catch (V) {
|
|
433
|
+
console.warn(`Falha ao decodificar o token de acesso: ${V.message}`);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function U(m = !1) {
|
|
437
|
+
return m || !t.onRefreshTokenExpire ? N() : t.onRefreshTokenExpire({ login: N });
|
|
438
438
|
}
|
|
439
|
-
function te(
|
|
440
|
-
if (i &&
|
|
441
|
-
if (
|
|
442
|
-
return
|
|
439
|
+
function te(m = !1) {
|
|
440
|
+
if (i && at(g) && !(E && !m)) {
|
|
441
|
+
if (at(c))
|
|
442
|
+
return U(m);
|
|
443
443
|
if (s) {
|
|
444
|
-
P(!0),
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
447
|
-
return
|
|
448
|
-
console.error(
|
|
444
|
+
P(!0), fr({ config: t, refreshToken: s }).then((y) => X(y)).catch((y) => {
|
|
445
|
+
if (y instanceof gt) {
|
|
446
|
+
if (y.status === 400)
|
|
447
|
+
return U(m);
|
|
448
|
+
console.error(y), f(y.message), m && N();
|
|
449
449
|
} else
|
|
450
|
-
|
|
450
|
+
y instanceof Error && (console.error(y), f(y.message), m && N());
|
|
451
451
|
}).finally(() => {
|
|
452
452
|
P(!1);
|
|
453
453
|
});
|
|
@@ -458,29 +458,29 @@ const Te = (r) => {
|
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
if (
|
|
465
|
-
const
|
|
466
|
-
if (!
|
|
467
|
-
const
|
|
468
|
-
console.error(
|
|
461
|
+
Y(() => (_ = setInterval(() => te(), 1e4), () => clearInterval(_)), [i, s, c, g]);
|
|
462
|
+
const ae = We(!1);
|
|
463
|
+
return Y(() => {
|
|
464
|
+
if (b) {
|
|
465
|
+
const m = new URLSearchParams(window.location.search);
|
|
466
|
+
if (!m.get("code")) {
|
|
467
|
+
const y = m.get("error_description") || "Estado de autorização inválido. Atualizar a página pode resolver o problema.";
|
|
468
|
+
console.error(y), f(y), L();
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
if (!
|
|
472
|
-
|
|
471
|
+
if (!ae.current) {
|
|
472
|
+
ae.current = !0;
|
|
473
473
|
try {
|
|
474
|
-
|
|
475
|
-
} catch (
|
|
476
|
-
console.error(
|
|
474
|
+
gr(m);
|
|
475
|
+
} catch (y) {
|
|
476
|
+
console.error(y), f(y.message);
|
|
477
477
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}).catch((
|
|
481
|
-
console.error(
|
|
478
|
+
pr(t).then((y) => {
|
|
479
|
+
X(y), t?.postLogin && t.postLogin();
|
|
480
|
+
}).catch((y) => {
|
|
481
|
+
console.error(y), f(y.message);
|
|
482
482
|
}).finally(() => {
|
|
483
|
-
t.clearURL && window.history.replaceState(null, "", window.location.pathname),
|
|
483
|
+
t.clearURL && window.history.replaceState(null, "", window.location.pathname), v(!1);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
return;
|
|
@@ -488,25 +488,25 @@ const Te = (r) => {
|
|
|
488
488
|
if (!i && t.autoLogin)
|
|
489
489
|
return N();
|
|
490
490
|
try {
|
|
491
|
-
|
|
492
|
-
} catch (
|
|
493
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
491
|
+
u && D(Ue(u));
|
|
492
|
+
} catch (m) {
|
|
493
|
+
console.warn(`Falha ao decodificar idToken: ${m.message}`);
|
|
494
494
|
}
|
|
495
495
|
try {
|
|
496
|
-
t.decodeToken && B(
|
|
497
|
-
} catch (
|
|
498
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
496
|
+
t.decodeToken && B(Ue(i));
|
|
497
|
+
} catch (m) {
|
|
498
|
+
console.warn(`Falha ao decodificar o token de acesso: ${m.message}`);
|
|
499
499
|
}
|
|
500
500
|
te(!0);
|
|
501
501
|
}, []), /* @__PURE__ */ o(
|
|
502
|
-
|
|
502
|
+
Ar.Provider,
|
|
503
503
|
{
|
|
504
|
-
value: { token: i, tokenData: M, idToken:
|
|
504
|
+
value: { token: i, tokenData: M, idToken: u, idTokenData: F, login: N, logOut: L, error: w, loginInProgress: b },
|
|
505
505
|
children: e
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
508
|
};
|
|
509
|
-
class
|
|
509
|
+
class wt {
|
|
510
510
|
resourceService;
|
|
511
511
|
resource;
|
|
512
512
|
actions;
|
|
@@ -515,7 +515,7 @@ class vt {
|
|
|
515
515
|
error;
|
|
516
516
|
isAdmin;
|
|
517
517
|
constructor(e, t, s) {
|
|
518
|
-
this.resourceService =
|
|
518
|
+
this.resourceService = Ft.getContainer().get(q.Resource), this.resource = { resourceName: e, resourceDescription: t }, this.alreadyApplied = !1, this.actions = [], this.permissions = [], this.error = "", this.isAdmin = s;
|
|
519
519
|
}
|
|
520
520
|
registerAction(e, t) {
|
|
521
521
|
!this.alreadyApplied && this.actions.findIndex((s) => s.actionName === e) < 0 && this.actions.push({ actionName: e, actionDescription: t });
|
|
@@ -586,10 +586,10 @@ class vt {
|
|
|
586
586
|
return [...this.actions];
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
class
|
|
589
|
+
class G {
|
|
590
590
|
static instance;
|
|
591
|
-
_currentTenant = new
|
|
592
|
-
_availableTenants = new
|
|
591
|
+
_currentTenant = new tt(null);
|
|
592
|
+
_availableTenants = new tt([]);
|
|
593
593
|
constructor() {
|
|
594
594
|
const e = localStorage.getItem("tenant_info");
|
|
595
595
|
if (e)
|
|
@@ -600,7 +600,7 @@ class J {
|
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
static getInstance() {
|
|
603
|
-
return
|
|
603
|
+
return G.instance || (G.instance = new G()), G.instance;
|
|
604
604
|
}
|
|
605
605
|
get currentTenant$() {
|
|
606
606
|
return this._currentTenant.asObservable();
|
|
@@ -629,15 +629,15 @@ class J {
|
|
|
629
629
|
return t && (e["X-TENANT-ID"] = t.id), e;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
return
|
|
632
|
+
function Kr() {
|
|
633
|
+
return G.getInstance();
|
|
634
634
|
}
|
|
635
|
-
var
|
|
636
|
-
for (var n = void 0,
|
|
637
|
-
(
|
|
638
|
-
return n &&
|
|
639
|
-
},
|
|
640
|
-
const
|
|
635
|
+
var ge = /* @__PURE__ */ ((r) => (r.USER = "user", r.PROFILE = "profile", r.GROUP = "group", r))(ge || {}), Er = Object.defineProperty, A = (r, e, t, s) => {
|
|
636
|
+
for (var n = void 0, c = r.length - 1, l; c >= 0; c--)
|
|
637
|
+
(l = r[c]) && (n = l(e, t, n) || n);
|
|
638
|
+
return n && Er(e, t, n), n;
|
|
639
|
+
}, xr = /* @__PURE__ */ ((r) => (r.VIEW = "VIEW", r.API = "API", r))(xr || {});
|
|
640
|
+
const bt = class At {
|
|
641
641
|
id;
|
|
642
642
|
code;
|
|
643
643
|
version;
|
|
@@ -648,20 +648,20 @@ const wt = class bt {
|
|
|
648
648
|
description;
|
|
649
649
|
intervals;
|
|
650
650
|
constructor(e) {
|
|
651
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.description = e.description || "", this.intervals = e.intervals ? e.intervals.map((t) => new
|
|
651
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.description = e.description || "", this.intervals = e.intervals ? e.intervals.map((t) => new Sr(t)) : [];
|
|
652
652
|
}
|
|
653
|
-
static newInstance = () => new
|
|
654
|
-
id:
|
|
653
|
+
static newInstance = () => new At({
|
|
654
|
+
id: ee(),
|
|
655
655
|
intervals: []
|
|
656
656
|
});
|
|
657
657
|
};
|
|
658
|
-
|
|
658
|
+
A([
|
|
659
659
|
Q({
|
|
660
660
|
message: "archbase:Informe a descrição do cronograma de acesso"
|
|
661
661
|
})
|
|
662
|
-
],
|
|
663
|
-
let
|
|
664
|
-
const
|
|
662
|
+
], bt.prototype, "description");
|
|
663
|
+
let Et = bt;
|
|
664
|
+
const Re = class xt {
|
|
665
665
|
id;
|
|
666
666
|
code;
|
|
667
667
|
version;
|
|
@@ -674,30 +674,30 @@ const _e = class Et {
|
|
|
674
674
|
startTime;
|
|
675
675
|
endTime;
|
|
676
676
|
constructor(e) {
|
|
677
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.accessSchedule = e.accessSchedule ? new
|
|
677
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.accessSchedule = e.accessSchedule ? new Et(e.accessSchedule) : void 0, this.dayOfWeek = e.dayOfWeek || 0, this.startTime = e.startTime || "", this.endTime = e.endTime || "";
|
|
678
678
|
}
|
|
679
|
-
static newInstance = () => new
|
|
680
|
-
id:
|
|
679
|
+
static newInstance = () => new xt({
|
|
680
|
+
id: ee(),
|
|
681
681
|
dayOfWeek: (/* @__PURE__ */ new Date()).getDay(),
|
|
682
682
|
startTime: "08:00",
|
|
683
683
|
endTime: "17:00"
|
|
684
684
|
});
|
|
685
685
|
};
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
],
|
|
689
|
-
|
|
686
|
+
A([
|
|
687
|
+
Z()
|
|
688
|
+
], Re.prototype, "accessSchedule");
|
|
689
|
+
A([
|
|
690
690
|
Q({
|
|
691
691
|
message: "archbase:Informe a hora de início"
|
|
692
692
|
})
|
|
693
|
-
],
|
|
694
|
-
|
|
693
|
+
], Re.prototype, "startTime");
|
|
694
|
+
A([
|
|
695
695
|
Q({
|
|
696
696
|
message: "archbase:Informe a hora de término"
|
|
697
697
|
})
|
|
698
|
-
],
|
|
699
|
-
let
|
|
700
|
-
class
|
|
698
|
+
], Re.prototype, "endTime");
|
|
699
|
+
let Sr = Re;
|
|
700
|
+
class ve {
|
|
701
701
|
id;
|
|
702
702
|
code;
|
|
703
703
|
version;
|
|
@@ -712,20 +712,20 @@ class ye {
|
|
|
712
712
|
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.actions = e.actions || [];
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
|
-
|
|
715
|
+
A([
|
|
716
716
|
Q({
|
|
717
717
|
message: "archbase:Informe o nome"
|
|
718
718
|
})
|
|
719
|
-
],
|
|
720
|
-
|
|
719
|
+
], ve.prototype, "name");
|
|
720
|
+
A([
|
|
721
721
|
Q({
|
|
722
722
|
message: "archbase:Informe a descrição"
|
|
723
723
|
})
|
|
724
|
-
],
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
],
|
|
728
|
-
const
|
|
724
|
+
], ve.prototype, "description");
|
|
725
|
+
A([
|
|
726
|
+
Z()
|
|
727
|
+
], ve.prototype, "actions");
|
|
728
|
+
const we = class St {
|
|
729
729
|
id;
|
|
730
730
|
code;
|
|
731
731
|
version;
|
|
@@ -741,48 +741,48 @@ const ve = class xt {
|
|
|
741
741
|
actionVersion;
|
|
742
742
|
isNewAction;
|
|
743
743
|
constructor(e) {
|
|
744
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.resource = e.resource ? new
|
|
744
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.resource = e.resource ? new It(e.resource) : void 0, this.category = e.category || "", this.active = e.active || !1, this.actionVersion = e.actionVersion || "", this.isNewAction = e.isNewAction || !1;
|
|
745
745
|
}
|
|
746
|
-
static newInstance = () => new
|
|
747
|
-
id:
|
|
746
|
+
static newInstance = () => new St({
|
|
747
|
+
id: ee(),
|
|
748
748
|
active: !0,
|
|
749
749
|
isNewAction: !0
|
|
750
750
|
});
|
|
751
751
|
};
|
|
752
|
-
|
|
752
|
+
A([
|
|
753
753
|
Q({
|
|
754
754
|
message: "archbase:Informe o nome para a ação"
|
|
755
755
|
})
|
|
756
|
-
],
|
|
757
|
-
|
|
756
|
+
], we.prototype, "name");
|
|
757
|
+
A([
|
|
758
758
|
Q({
|
|
759
759
|
message: "archbase:Informe a descrição para a ação"
|
|
760
760
|
})
|
|
761
|
-
],
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
],
|
|
765
|
-
|
|
761
|
+
], we.prototype, "description");
|
|
762
|
+
A([
|
|
763
|
+
Z()
|
|
764
|
+
], we.prototype, "resource");
|
|
765
|
+
A([
|
|
766
766
|
Q({
|
|
767
767
|
message: "archbase:Informe a categoria para a ação"
|
|
768
768
|
})
|
|
769
|
-
],
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
],
|
|
773
|
-
let
|
|
774
|
-
class
|
|
769
|
+
], we.prototype, "category");
|
|
770
|
+
A([
|
|
771
|
+
se()
|
|
772
|
+
], we.prototype, "active");
|
|
773
|
+
let kr = we;
|
|
774
|
+
class ke extends ve {
|
|
775
775
|
type;
|
|
776
776
|
isNewProfile;
|
|
777
777
|
constructor(e) {
|
|
778
|
-
super(e), this.type =
|
|
778
|
+
super(e), this.type = ge.PROFILE, this.isNewProfile = e.isNewProfile || !1;
|
|
779
779
|
}
|
|
780
|
-
static newInstance = () => new
|
|
781
|
-
id:
|
|
780
|
+
static newInstance = () => new ke({
|
|
781
|
+
id: ee(),
|
|
782
782
|
isNewProfile: !0
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
class
|
|
785
|
+
class Ke {
|
|
786
786
|
id;
|
|
787
787
|
code;
|
|
788
788
|
version;
|
|
@@ -792,25 +792,25 @@ class Ge {
|
|
|
792
792
|
lastModifiedByUser;
|
|
793
793
|
group;
|
|
794
794
|
constructor(e) {
|
|
795
|
-
this.id = e.id, this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.group = e.group ? new
|
|
795
|
+
this.id = e.id, this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.group = e.group ? new Ie(e.group) : void 0;
|
|
796
796
|
}
|
|
797
|
-
static newInstance = (e) => new
|
|
798
|
-
id:
|
|
797
|
+
static newInstance = (e) => new Ke({
|
|
798
|
+
id: ee(),
|
|
799
799
|
group: e
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
|
-
class
|
|
802
|
+
class Ie extends ve {
|
|
803
803
|
type;
|
|
804
804
|
isNewGroup;
|
|
805
805
|
constructor(e) {
|
|
806
|
-
super(e), this.type =
|
|
806
|
+
super(e), this.type = ge.GROUP, this.isNewGroup = e.isNewGroup || !1;
|
|
807
807
|
}
|
|
808
|
-
static newInstance = () => new
|
|
809
|
-
id:
|
|
808
|
+
static newInstance = () => new Ie({
|
|
809
|
+
id: ee(),
|
|
810
810
|
isNewGroup: !0
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
const
|
|
813
|
+
const Me = class kt {
|
|
814
814
|
id;
|
|
815
815
|
code;
|
|
816
816
|
version;
|
|
@@ -827,28 +827,28 @@ const Re = class St {
|
|
|
827
827
|
constructor(e) {
|
|
828
828
|
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.actions = e.actions || [], this.active = e.active || !1, this.type = e.type || "VIEW", this.isNewResource = e.isNewResource || !1;
|
|
829
829
|
}
|
|
830
|
-
static newInstance = () => new
|
|
831
|
-
id:
|
|
830
|
+
static newInstance = () => new kt({
|
|
831
|
+
id: ee(),
|
|
832
832
|
actions: [],
|
|
833
833
|
active: !0,
|
|
834
834
|
isNewResource: !0
|
|
835
835
|
});
|
|
836
836
|
};
|
|
837
|
-
|
|
837
|
+
A([
|
|
838
838
|
Q({
|
|
839
839
|
message: "archbase:Informe o nome para o recurso"
|
|
840
840
|
})
|
|
841
|
-
],
|
|
842
|
-
|
|
841
|
+
], Me.prototype, "name");
|
|
842
|
+
A([
|
|
843
843
|
Q({
|
|
844
844
|
message: "archbase:Informe a descrição para o recurso"
|
|
845
845
|
})
|
|
846
|
-
],
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
],
|
|
850
|
-
let
|
|
851
|
-
const
|
|
846
|
+
], Me.prototype, "description");
|
|
847
|
+
A([
|
|
848
|
+
se()
|
|
849
|
+
], Me.prototype, "active");
|
|
850
|
+
let It = Me;
|
|
851
|
+
const O = class Ct extends ve {
|
|
852
852
|
userName;
|
|
853
853
|
password;
|
|
854
854
|
changePasswordOnNextLogin;
|
|
@@ -868,11 +868,13 @@ const F = class It extends ye {
|
|
|
868
868
|
email;
|
|
869
869
|
type;
|
|
870
870
|
isNewUser;
|
|
871
|
+
employeeId;
|
|
872
|
+
externalId;
|
|
871
873
|
constructor(e) {
|
|
872
|
-
super(e), this.type =
|
|
874
|
+
super(e), this.type = ge.USER, this.userName = e.userName || "", this.password = e.password || "", this.changePasswordOnNextLogin = e.changePasswordOnNextLogin || !1, this.allowPasswordChange = e.allowPasswordChange || !1, this.allowMultipleLogins = e.allowMultipleLogins || !1, this.passwordNeverExpires = e.passwordNeverExpires || !1, this.passwordChangedAt = e.passwordChangedAt || void 0, this.accountDeactivated = e.accountDeactivated || !1, this.accountLocked = e.accountLocked || !1, this.unlimitedAccessHours = e.unlimitedAccessHours || !1, this.isAdministrator = e.isAdministrator || !1, this.accessSchedule = e.accessSchedule ? new Et(e.accessSchedule) : void 0, this.groups = e.groups ? e.groups.map((t) => new Ke(t)) : [], this.profile = e.profile ? new ke(e.profile) : void 0, this.email = e.email || "", this.avatar = e.avatar || void 0, this.isNewUser = e.isNewUser || !1, this.nickname = e.nickname, this.employeeId = e.employeeId || void 0, this.externalId = e.externalId || void 0;
|
|
873
875
|
}
|
|
874
|
-
static newInstance = () => new
|
|
875
|
-
id:
|
|
876
|
+
static newInstance = () => new Ct({
|
|
877
|
+
id: ee(),
|
|
876
878
|
userName: "",
|
|
877
879
|
password: "",
|
|
878
880
|
groups: [],
|
|
@@ -883,57 +885,63 @@ const F = class It extends ye {
|
|
|
883
885
|
isNewUser: !0
|
|
884
886
|
});
|
|
885
887
|
};
|
|
886
|
-
|
|
888
|
+
A([
|
|
887
889
|
Q({
|
|
888
890
|
message: "archbase:Informe o nome de usuário"
|
|
889
891
|
})
|
|
890
|
-
],
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
],
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
],
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
],
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
],
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
],
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
],
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
],
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
],
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
],
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
],
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
],
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
],
|
|
927
|
-
|
|
928
|
-
|
|
892
|
+
], O.prototype, "userName");
|
|
893
|
+
A([
|
|
894
|
+
se()
|
|
895
|
+
], O.prototype, "changePasswordOnNextLogin");
|
|
896
|
+
A([
|
|
897
|
+
se()
|
|
898
|
+
], O.prototype, "allowPasswordChange");
|
|
899
|
+
A([
|
|
900
|
+
se()
|
|
901
|
+
], O.prototype, "allowMultipleLogins");
|
|
902
|
+
A([
|
|
903
|
+
se()
|
|
904
|
+
], O.prototype, "passwordNeverExpires");
|
|
905
|
+
A([
|
|
906
|
+
Z()
|
|
907
|
+
], O.prototype, "passwordChangedAt");
|
|
908
|
+
A([
|
|
909
|
+
se()
|
|
910
|
+
], O.prototype, "accountDeactivated");
|
|
911
|
+
A([
|
|
912
|
+
se()
|
|
913
|
+
], O.prototype, "accountLocked");
|
|
914
|
+
A([
|
|
915
|
+
se()
|
|
916
|
+
], O.prototype, "unlimitedAccessHours");
|
|
917
|
+
A([
|
|
918
|
+
se()
|
|
919
|
+
], O.prototype, "isAdministrator");
|
|
920
|
+
A([
|
|
921
|
+
Z()
|
|
922
|
+
], O.prototype, "accessSchedule");
|
|
923
|
+
A([
|
|
924
|
+
Z()
|
|
925
|
+
], O.prototype, "groups");
|
|
926
|
+
A([
|
|
927
|
+
Z()
|
|
928
|
+
], O.prototype, "profile");
|
|
929
|
+
A([
|
|
930
|
+
Ht(
|
|
929
931
|
{},
|
|
930
932
|
{
|
|
931
933
|
message: "archbase:Informe um email válido"
|
|
932
934
|
}
|
|
933
935
|
)
|
|
934
|
-
],
|
|
935
|
-
|
|
936
|
-
|
|
936
|
+
], O.prototype, "email");
|
|
937
|
+
A([
|
|
938
|
+
Z()
|
|
939
|
+
], O.prototype, "employeeId");
|
|
940
|
+
A([
|
|
941
|
+
Z()
|
|
942
|
+
], O.prototype, "externalId");
|
|
943
|
+
let Ne = O;
|
|
944
|
+
const qe = class He {
|
|
937
945
|
id;
|
|
938
946
|
code;
|
|
939
947
|
version;
|
|
@@ -947,35 +955,35 @@ const Je = class Fe {
|
|
|
947
955
|
companyId;
|
|
948
956
|
projectId;
|
|
949
957
|
constructor(e) {
|
|
950
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.security = e.security ?
|
|
958
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.security = e.security ? He.createDtoFromJson(e.security) : void 0, this.action = e.action ? new kr(e.action) : void 0, this.tenantId = e.tenantId || "", this.companyId = e.companyId || "", this.projectId = e.projectId || "";
|
|
951
959
|
}
|
|
952
960
|
static createDtoFromJson(e) {
|
|
953
961
|
switch (e.type) {
|
|
954
962
|
case "profile":
|
|
955
|
-
return new Se(e);
|
|
956
|
-
case "group":
|
|
957
963
|
return new ke(e);
|
|
964
|
+
case "group":
|
|
965
|
+
return new Ie(e);
|
|
958
966
|
case "user":
|
|
959
|
-
return new
|
|
967
|
+
return new Ne(e);
|
|
960
968
|
default:
|
|
961
969
|
throw new Error("Unknown DTO type");
|
|
962
970
|
}
|
|
963
971
|
}
|
|
964
|
-
static newInstance = () => new
|
|
965
|
-
id:
|
|
972
|
+
static newInstance = () => new He({
|
|
973
|
+
id: ee(),
|
|
966
974
|
tenantId: "",
|
|
967
975
|
companyId: "",
|
|
968
976
|
projectId: ""
|
|
969
977
|
});
|
|
970
978
|
};
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
],
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
],
|
|
977
|
-
let
|
|
978
|
-
class
|
|
979
|
+
A([
|
|
980
|
+
Z()
|
|
981
|
+
], qe.prototype, "security");
|
|
982
|
+
A([
|
|
983
|
+
Z()
|
|
984
|
+
], qe.prototype, "action");
|
|
985
|
+
let qr = qe;
|
|
986
|
+
class Ye {
|
|
979
987
|
id;
|
|
980
988
|
code;
|
|
981
989
|
version;
|
|
@@ -993,13 +1001,13 @@ class Ke {
|
|
|
993
1001
|
activated;
|
|
994
1002
|
isNovoToken;
|
|
995
1003
|
constructor(e) {
|
|
996
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.tenantId = e.tenantId || "", this.user = e.user ? new
|
|
1004
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.tenantId = e.tenantId || "", this.user = e.user ? new Ne(e.user) : void 0, this.name = e.name || "", this.description = e.description || "", this.token = e.token || "", this.expirationDate = e.expirationDate, this.revoked = e.revoked, this.activated = e.activated || !1;
|
|
997
1005
|
}
|
|
998
|
-
static newInstance = () => new
|
|
999
|
-
id:
|
|
1006
|
+
static newInstance = () => new Ye({
|
|
1007
|
+
id: ee()
|
|
1000
1008
|
});
|
|
1001
1009
|
}
|
|
1002
|
-
class
|
|
1010
|
+
class Xe {
|
|
1003
1011
|
id;
|
|
1004
1012
|
code;
|
|
1005
1013
|
version;
|
|
@@ -1016,23 +1024,23 @@ class qe {
|
|
|
1016
1024
|
user;
|
|
1017
1025
|
isNewAccessToken;
|
|
1018
1026
|
constructor(e) {
|
|
1019
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.token = e.token || "", this.tokenType = e.tokenType || void 0, this.user = e.user ? new
|
|
1027
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.token = e.token || "", this.tokenType = e.tokenType || void 0, this.user = e.user ? new Ne(e.user) : void 0, this.revoked = e.revoked || !1, this.expired = e.expired || !1, this.expirationTime = e.expirationTime || 0, this.expirationDate = e.expirationDate || "", this.isNewAccessToken = e.isNewAccessToken || !1;
|
|
1020
1028
|
}
|
|
1021
|
-
static newInstance = () => new
|
|
1022
|
-
id:
|
|
1029
|
+
static newInstance = () => new Xe({
|
|
1030
|
+
id: ee(),
|
|
1023
1031
|
active: !0,
|
|
1024
1032
|
isNewAccessToken: !0
|
|
1025
1033
|
});
|
|
1026
1034
|
}
|
|
1027
|
-
class
|
|
1035
|
+
class Pt extends ye {
|
|
1028
1036
|
constructor(e) {
|
|
1029
1037
|
super(e);
|
|
1030
1038
|
}
|
|
1031
1039
|
configureHeaders() {
|
|
1032
|
-
return
|
|
1040
|
+
return G.getInstance().getHeaders();
|
|
1033
1041
|
}
|
|
1034
1042
|
transform(e) {
|
|
1035
|
-
return new
|
|
1043
|
+
return new Ne(e);
|
|
1036
1044
|
}
|
|
1037
1045
|
getEndpoint() {
|
|
1038
1046
|
return "/api/v1/user";
|
|
@@ -1051,17 +1059,17 @@ class Ct extends ge {
|
|
|
1051
1059
|
return this.transform(t);
|
|
1052
1060
|
}
|
|
1053
1061
|
}
|
|
1054
|
-
I.decorate(I.inject(
|
|
1055
|
-
I.decorate(I.injectable(),
|
|
1056
|
-
class
|
|
1062
|
+
I.decorate(I.inject(q.ApiClient), Pt, 0);
|
|
1063
|
+
I.decorate(I.injectable(), Pt);
|
|
1064
|
+
class Tt extends ye {
|
|
1057
1065
|
constructor(e) {
|
|
1058
1066
|
super(e);
|
|
1059
1067
|
}
|
|
1060
1068
|
configureHeaders() {
|
|
1061
|
-
return
|
|
1069
|
+
return G.getInstance().getHeaders();
|
|
1062
1070
|
}
|
|
1063
1071
|
transform(e) {
|
|
1064
|
-
return new
|
|
1072
|
+
return new Ie(e);
|
|
1065
1073
|
}
|
|
1066
1074
|
getEndpoint() {
|
|
1067
1075
|
return "/api/v1/group";
|
|
@@ -1073,17 +1081,17 @@ class Pt extends ge {
|
|
|
1073
1081
|
return e.isNewGroup;
|
|
1074
1082
|
}
|
|
1075
1083
|
}
|
|
1076
|
-
I.decorate(I.inject(
|
|
1077
|
-
I.decorate(I.injectable(),
|
|
1078
|
-
class
|
|
1084
|
+
I.decorate(I.inject(q.ApiClient), Tt, 0);
|
|
1085
|
+
I.decorate(I.injectable(), Tt);
|
|
1086
|
+
class Ut extends ye {
|
|
1079
1087
|
constructor(e) {
|
|
1080
1088
|
super(e);
|
|
1081
1089
|
}
|
|
1082
1090
|
configureHeaders() {
|
|
1083
|
-
return
|
|
1091
|
+
return G.getInstance().getHeaders();
|
|
1084
1092
|
}
|
|
1085
1093
|
transform(e) {
|
|
1086
|
-
return new
|
|
1094
|
+
return new ke(e);
|
|
1087
1095
|
}
|
|
1088
1096
|
getEndpoint() {
|
|
1089
1097
|
return "/api/v1/userProfile";
|
|
@@ -1095,17 +1103,17 @@ class Tt extends ge {
|
|
|
1095
1103
|
return e.isNewProfile;
|
|
1096
1104
|
}
|
|
1097
1105
|
}
|
|
1098
|
-
I.decorate(I.inject(
|
|
1099
|
-
I.decorate(I.injectable(),
|
|
1100
|
-
class
|
|
1106
|
+
I.decorate(I.inject(q.ApiClient), Ut, 0);
|
|
1107
|
+
I.decorate(I.injectable(), Ut);
|
|
1108
|
+
class Dt extends ye {
|
|
1101
1109
|
constructor(e) {
|
|
1102
1110
|
super(e);
|
|
1103
1111
|
}
|
|
1104
1112
|
configureHeaders() {
|
|
1105
|
-
return
|
|
1113
|
+
return G.getInstance().getHeaders();
|
|
1106
1114
|
}
|
|
1107
1115
|
transform(e) {
|
|
1108
|
-
return new
|
|
1116
|
+
return new Ye(e);
|
|
1109
1117
|
}
|
|
1110
1118
|
getEndpoint() {
|
|
1111
1119
|
return "/api/v1/apiToken";
|
|
@@ -1117,12 +1125,12 @@ class Ut extends ge {
|
|
|
1117
1125
|
return e.isNovoToken;
|
|
1118
1126
|
}
|
|
1119
1127
|
async create(e, t, s, n) {
|
|
1120
|
-
const
|
|
1128
|
+
const c = await this.client.post(
|
|
1121
1129
|
`${this.getEndpoint()}/create?email=${e}&expirationDate=${t}&name=${s}&description=${n}`,
|
|
1122
1130
|
void 0,
|
|
1123
1131
|
this.configureHeaders()
|
|
1124
1132
|
);
|
|
1125
|
-
return this.transform(
|
|
1133
|
+
return this.transform(c);
|
|
1126
1134
|
}
|
|
1127
1135
|
async revoke(e) {
|
|
1128
1136
|
await this.client.post(
|
|
@@ -1132,17 +1140,17 @@ class Ut extends ge {
|
|
|
1132
1140
|
);
|
|
1133
1141
|
}
|
|
1134
1142
|
}
|
|
1135
|
-
I.decorate(I.inject(
|
|
1136
|
-
I.decorate(I.injectable(),
|
|
1137
|
-
class
|
|
1143
|
+
I.decorate(I.inject(q.ApiClient), Dt, 0);
|
|
1144
|
+
I.decorate(I.injectable(), Dt);
|
|
1145
|
+
class _t extends ye {
|
|
1138
1146
|
constructor(e) {
|
|
1139
1147
|
super(e);
|
|
1140
1148
|
}
|
|
1141
1149
|
configureHeaders() {
|
|
1142
|
-
return
|
|
1150
|
+
return G.getInstance().getHeaders();
|
|
1143
1151
|
}
|
|
1144
1152
|
transform(e) {
|
|
1145
|
-
return new
|
|
1153
|
+
return new Xe(e);
|
|
1146
1154
|
}
|
|
1147
1155
|
getEndpoint() {
|
|
1148
1156
|
return "/api/v1/accessToken";
|
|
@@ -1161,17 +1169,17 @@ class Dt extends ge {
|
|
|
1161
1169
|
);
|
|
1162
1170
|
}
|
|
1163
1171
|
}
|
|
1164
|
-
I.decorate(I.inject(
|
|
1165
|
-
I.decorate(I.injectable(),
|
|
1166
|
-
class
|
|
1172
|
+
I.decorate(I.inject(q.ApiClient), _t, 0);
|
|
1173
|
+
I.decorate(I.injectable(), _t);
|
|
1174
|
+
class Rt extends ye {
|
|
1167
1175
|
constructor(e) {
|
|
1168
1176
|
super(e);
|
|
1169
1177
|
}
|
|
1170
1178
|
configureHeaders() {
|
|
1171
|
-
return
|
|
1179
|
+
return G.getInstance().getHeaders();
|
|
1172
1180
|
}
|
|
1173
1181
|
transform(e) {
|
|
1174
|
-
return new
|
|
1182
|
+
return new It(e);
|
|
1175
1183
|
}
|
|
1176
1184
|
getEndpoint() {
|
|
1177
1185
|
return "/api/v1/resource";
|
|
@@ -1195,7 +1203,7 @@ class _t extends ge {
|
|
|
1195
1203
|
!1,
|
|
1196
1204
|
{
|
|
1197
1205
|
params: {
|
|
1198
|
-
type:
|
|
1206
|
+
type: et(ge, t)
|
|
1199
1207
|
}
|
|
1200
1208
|
}
|
|
1201
1209
|
);
|
|
@@ -1206,7 +1214,7 @@ class _t extends ge {
|
|
|
1206
1214
|
{
|
|
1207
1215
|
securityId: e,
|
|
1208
1216
|
actionId: t,
|
|
1209
|
-
type:
|
|
1217
|
+
type: et(ge, s)
|
|
1210
1218
|
},
|
|
1211
1219
|
this.configureHeaders()
|
|
1212
1220
|
);
|
|
@@ -1225,15 +1233,15 @@ class _t extends ge {
|
|
|
1225
1233
|
);
|
|
1226
1234
|
}
|
|
1227
1235
|
}
|
|
1228
|
-
I.decorate(I.inject(
|
|
1229
|
-
I.decorate(I.injectable(),
|
|
1230
|
-
class
|
|
1236
|
+
I.decorate(I.inject(q.ApiClient), Rt, 0);
|
|
1237
|
+
I.decorate(I.injectable(), Rt);
|
|
1238
|
+
class Mt {
|
|
1231
1239
|
client;
|
|
1232
1240
|
constructor(e) {
|
|
1233
1241
|
this.client = e;
|
|
1234
1242
|
}
|
|
1235
1243
|
configureHeaders() {
|
|
1236
|
-
return
|
|
1244
|
+
return G.getInstance().getHeaders();
|
|
1237
1245
|
}
|
|
1238
1246
|
getEndpoint() {
|
|
1239
1247
|
return "/api/v1/security/diagnostics";
|
|
@@ -1345,86 +1353,86 @@ class Rt {
|
|
|
1345
1353
|
);
|
|
1346
1354
|
}
|
|
1347
1355
|
}
|
|
1348
|
-
I.decorate(I.inject(
|
|
1349
|
-
I.decorate(I.injectable(),
|
|
1350
|
-
function
|
|
1356
|
+
I.decorate(I.inject(q.ApiClient), Mt, 0);
|
|
1357
|
+
I.decorate(I.injectable(), Mt);
|
|
1358
|
+
function Yr({
|
|
1351
1359
|
onLogin: r,
|
|
1352
1360
|
error: e,
|
|
1353
1361
|
onClickForgotPassword: t,
|
|
1354
1362
|
loginLabel: s = "Email",
|
|
1355
1363
|
loginPlaceholder: n,
|
|
1356
|
-
afterInputs:
|
|
1357
|
-
showMockUsersSelector:
|
|
1364
|
+
afterInputs: c,
|
|
1365
|
+
showMockUsersSelector: l = !1,
|
|
1358
1366
|
mockUsers: i = [],
|
|
1359
1367
|
mockUsersGroupMap: d,
|
|
1360
|
-
options:
|
|
1368
|
+
options: g = {},
|
|
1361
1369
|
onChangeUsername: k,
|
|
1362
|
-
disabledLogin:
|
|
1363
|
-
isCheckingUsername:
|
|
1364
|
-
showSignIn:
|
|
1365
|
-
mfaRequired:
|
|
1370
|
+
disabledLogin: u = !1,
|
|
1371
|
+
isCheckingUsername: T = !1,
|
|
1372
|
+
showSignIn: b = !0,
|
|
1373
|
+
mfaRequired: v = !1,
|
|
1366
1374
|
onVerifyMfa: E,
|
|
1367
1375
|
mfaError: P,
|
|
1368
1376
|
onCancelMfa: M,
|
|
1369
1377
|
isVerifyingMfa: B = !1
|
|
1370
1378
|
}) {
|
|
1371
|
-
const
|
|
1372
|
-
username:
|
|
1373
|
-
password:
|
|
1374
|
-
rememberMe:
|
|
1375
|
-
clearRememberMe:
|
|
1376
|
-
} =
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
}, [e]),
|
|
1380
|
-
|
|
1381
|
-
}, [
|
|
1379
|
+
const F = ht(), {
|
|
1380
|
+
username: D,
|
|
1381
|
+
password: w,
|
|
1382
|
+
rememberMe: f,
|
|
1383
|
+
clearRememberMe: _
|
|
1384
|
+
} = Vt(), [H, L] = p(D), [N, X] = p(w), [U, te] = p(f), [ae, m] = p(!1), [y, J] = p(null), [V, be] = p("");
|
|
1385
|
+
Y(() => {
|
|
1386
|
+
m(!!e);
|
|
1387
|
+
}, [e]), Y(() => {
|
|
1388
|
+
D !== H && (L(D), k?.(D)), w !== N && X(w), f !== U && te(f);
|
|
1389
|
+
}, [D, w, f]);
|
|
1382
1390
|
const he = () => {
|
|
1383
|
-
|
|
1391
|
+
m(!1);
|
|
1384
1392
|
}, $ = () => {
|
|
1385
|
-
|
|
1393
|
+
H && N && r(H, N, U).finally(() => m(!0));
|
|
1386
1394
|
}, ce = () => {
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1395
|
+
const a = V.trim();
|
|
1396
|
+
a && E && E(a);
|
|
1389
1397
|
}, ne = () => {
|
|
1390
1398
|
if (!d)
|
|
1391
|
-
return i.map((
|
|
1392
|
-
value:
|
|
1393
|
-
label:
|
|
1399
|
+
return i.map((h) => ({
|
|
1400
|
+
value: h.email,
|
|
1401
|
+
label: h.email
|
|
1394
1402
|
}));
|
|
1395
|
-
const
|
|
1396
|
-
const
|
|
1397
|
-
return
|
|
1398
|
-
value:
|
|
1399
|
-
label:
|
|
1400
|
-
})),
|
|
1403
|
+
const a = i.reduce((h, x) => {
|
|
1404
|
+
const R = d[x.type];
|
|
1405
|
+
return R && (h[R] || (h[R] = []), h[R].push({
|
|
1406
|
+
value: x.email,
|
|
1407
|
+
label: x.email
|
|
1408
|
+
})), h;
|
|
1401
1409
|
}, {});
|
|
1402
|
-
return Object.entries(
|
|
1403
|
-
group:
|
|
1404
|
-
items:
|
|
1410
|
+
return Object.entries(a).map(([h, x]) => ({
|
|
1411
|
+
group: h,
|
|
1412
|
+
items: x
|
|
1405
1413
|
}));
|
|
1406
|
-
},
|
|
1407
|
-
if (
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1414
|
+
}, Ae = () => {
|
|
1415
|
+
if (y) {
|
|
1416
|
+
const a = i.find((h) => h.email === y);
|
|
1417
|
+
a && (L(a.email), X(a.password), he());
|
|
1410
1418
|
}
|
|
1411
|
-
},
|
|
1419
|
+
}, pe = {
|
|
1412
1420
|
withBorder: !0,
|
|
1413
1421
|
shadow: "md",
|
|
1414
1422
|
p: 30,
|
|
1415
1423
|
mt: 30,
|
|
1416
1424
|
radius: "md",
|
|
1417
1425
|
w: 400,
|
|
1418
|
-
...
|
|
1426
|
+
...g.cardProps
|
|
1419
1427
|
};
|
|
1420
1428
|
return /* @__PURE__ */ C(
|
|
1421
|
-
|
|
1429
|
+
Je,
|
|
1422
1430
|
{
|
|
1423
|
-
...
|
|
1431
|
+
...pe,
|
|
1424
1432
|
pos: "relative",
|
|
1425
|
-
ref:
|
|
1433
|
+
ref: F,
|
|
1426
1434
|
children: [
|
|
1427
|
-
|
|
1435
|
+
b && /* @__PURE__ */ C(ie, { children: [
|
|
1428
1436
|
/* @__PURE__ */ o(
|
|
1429
1437
|
j,
|
|
1430
1438
|
{
|
|
@@ -1433,46 +1441,46 @@ function qr({
|
|
|
1433
1441
|
fz: { base: "20px", md: "35px" },
|
|
1434
1442
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1435
1443
|
mt: "xs",
|
|
1436
|
-
children:
|
|
1444
|
+
children: S().t("archbase:signIn")
|
|
1437
1445
|
}
|
|
1438
1446
|
),
|
|
1439
|
-
/* @__PURE__ */ o(
|
|
1447
|
+
/* @__PURE__ */ o(De, { m: "md" })
|
|
1440
1448
|
] }),
|
|
1441
|
-
|
|
1442
|
-
|
|
1449
|
+
g?.customContentBefore,
|
|
1450
|
+
v && /* @__PURE__ */ C(xe, { gap: "md", children: [
|
|
1443
1451
|
/* @__PURE__ */ C("div", { children: [
|
|
1444
|
-
/* @__PURE__ */ o(j, { fw: 700, fz: "lg", children:
|
|
1445
|
-
/* @__PURE__ */ o(j, { c: "dimmed", fz: "sm", children:
|
|
1452
|
+
/* @__PURE__ */ o(j, { fw: 700, fz: "lg", children: S().t("archbase:mfa.title", "Verificação em duas etapas") }),
|
|
1453
|
+
/* @__PURE__ */ o(j, { c: "dimmed", fz: "sm", children: S().t(
|
|
1446
1454
|
"archbase:mfa.subtitle",
|
|
1447
1455
|
"Digite o código do seu aplicativo autenticador (ou um código de recuperação)."
|
|
1448
1456
|
) })
|
|
1449
1457
|
] }),
|
|
1450
1458
|
/* @__PURE__ */ o(
|
|
1451
|
-
|
|
1459
|
+
Se,
|
|
1452
1460
|
{
|
|
1453
|
-
label:
|
|
1461
|
+
label: S().t("archbase:mfa.code", "Código de verificação"),
|
|
1454
1462
|
placeholder: "000000",
|
|
1455
|
-
value:
|
|
1463
|
+
value: V,
|
|
1456
1464
|
autoFocus: !0,
|
|
1457
|
-
onChange: (
|
|
1458
|
-
onKeyDown: (
|
|
1459
|
-
|
|
1465
|
+
onChange: (a) => be(a.currentTarget.value),
|
|
1466
|
+
onKeyDown: (a) => {
|
|
1467
|
+
a.key === "Enter" && ce();
|
|
1460
1468
|
}
|
|
1461
1469
|
}
|
|
1462
1470
|
),
|
|
1463
1471
|
P && /* @__PURE__ */ o(j, { c: "red", fz: "sm", children: P }),
|
|
1464
1472
|
/* @__PURE__ */ o(
|
|
1465
|
-
|
|
1473
|
+
W,
|
|
1466
1474
|
{
|
|
1467
1475
|
fullWidth: !0,
|
|
1468
|
-
disabled: !
|
|
1476
|
+
disabled: !V.trim() || B,
|
|
1469
1477
|
loading: B,
|
|
1470
1478
|
onClick: ce,
|
|
1471
|
-
children:
|
|
1479
|
+
children: S().t("archbase:mfa.verify", "Verificar")
|
|
1472
1480
|
}
|
|
1473
1481
|
),
|
|
1474
1482
|
M && /* @__PURE__ */ o(
|
|
1475
|
-
|
|
1483
|
+
rt,
|
|
1476
1484
|
{
|
|
1477
1485
|
component: "button",
|
|
1478
1486
|
c: "var(--mantine-text-color)",
|
|
@@ -1480,59 +1488,59 @@ function qr({
|
|
|
1480
1488
|
ta: "center",
|
|
1481
1489
|
styles: { root: { cursor: "pointer" } },
|
|
1482
1490
|
onClick: M,
|
|
1483
|
-
children:
|
|
1491
|
+
children: S().t("archbase:mfa.back", "Voltar ao login")
|
|
1484
1492
|
}
|
|
1485
1493
|
)
|
|
1486
1494
|
] }),
|
|
1487
|
-
!
|
|
1488
|
-
|
|
1495
|
+
!v && /* @__PURE__ */ C(ie, { children: [
|
|
1496
|
+
l && /* @__PURE__ */ C(ie, { children: [
|
|
1489
1497
|
/* @__PURE__ */ C(ue, { gap: "sm", mb: "md", children: [
|
|
1490
1498
|
/* @__PURE__ */ o(
|
|
1491
|
-
|
|
1499
|
+
Xt,
|
|
1492
1500
|
{
|
|
1493
1501
|
placeholder: "Selecione um usuário mock",
|
|
1494
1502
|
data: ne(),
|
|
1495
|
-
value:
|
|
1496
|
-
onChange: (
|
|
1503
|
+
value: y,
|
|
1504
|
+
onChange: (a) => J(a ?? ""),
|
|
1497
1505
|
searchable: !0,
|
|
1498
1506
|
clearable: !0,
|
|
1499
1507
|
style: { flexGrow: 1 }
|
|
1500
1508
|
}
|
|
1501
1509
|
),
|
|
1502
|
-
/* @__PURE__ */ o(
|
|
1503
|
-
|
|
1510
|
+
/* @__PURE__ */ o(Qt, { label: "Aplicar", children: /* @__PURE__ */ o(
|
|
1511
|
+
W,
|
|
1504
1512
|
{
|
|
1505
1513
|
variant: "light",
|
|
1506
1514
|
size: "sm",
|
|
1507
|
-
onClick:
|
|
1508
|
-
disabled: !
|
|
1515
|
+
onClick: Ae,
|
|
1516
|
+
disabled: !y,
|
|
1509
1517
|
"aria-label": "Aplicar usuário mock selecionado",
|
|
1510
|
-
children: /* @__PURE__ */ o(
|
|
1518
|
+
children: /* @__PURE__ */ o(sr, { size: 16 })
|
|
1511
1519
|
}
|
|
1512
1520
|
) })
|
|
1513
1521
|
] }),
|
|
1514
|
-
/* @__PURE__ */ o(
|
|
1522
|
+
/* @__PURE__ */ o(De, { mb: "md" })
|
|
1515
1523
|
] }),
|
|
1516
1524
|
/* @__PURE__ */ o(
|
|
1517
|
-
|
|
1525
|
+
Se,
|
|
1518
1526
|
{
|
|
1519
1527
|
label: s,
|
|
1520
|
-
placeholder: n ??
|
|
1521
|
-
rightSection:
|
|
1522
|
-
value:
|
|
1528
|
+
placeholder: n ?? S().t("archbase:usuario@email.com"),
|
|
1529
|
+
rightSection: T ? /* @__PURE__ */ o(ut, { size: "xs" }) : null,
|
|
1530
|
+
value: H || "",
|
|
1523
1531
|
required: !0,
|
|
1524
|
-
onChange: (
|
|
1525
|
-
L(
|
|
1532
|
+
onChange: (a) => {
|
|
1533
|
+
L(a.currentTarget.value), k?.(a.currentTarget.value), he();
|
|
1526
1534
|
}
|
|
1527
1535
|
}
|
|
1528
1536
|
),
|
|
1529
1537
|
/* @__PURE__ */ o(
|
|
1530
|
-
|
|
1538
|
+
je,
|
|
1531
1539
|
{
|
|
1532
|
-
label:
|
|
1533
|
-
placeholder:
|
|
1534
|
-
onChange: (
|
|
1535
|
-
|
|
1540
|
+
label: S().t("archbase:Password"),
|
|
1541
|
+
placeholder: S().t("archbase:Sua senha"),
|
|
1542
|
+
onChange: (a) => {
|
|
1543
|
+
X(a.currentTarget.value), he();
|
|
1536
1544
|
},
|
|
1537
1545
|
value: N || "",
|
|
1538
1546
|
required: !0,
|
|
@@ -1541,18 +1549,18 @@ function qr({
|
|
|
1541
1549
|
),
|
|
1542
1550
|
/* @__PURE__ */ C(ue, { justify: "space-between", mt: "md", children: [
|
|
1543
1551
|
/* @__PURE__ */ o(
|
|
1544
|
-
|
|
1552
|
+
Zt,
|
|
1545
1553
|
{
|
|
1546
|
-
label:
|
|
1547
|
-
checked:
|
|
1548
|
-
onChange: (
|
|
1549
|
-
const
|
|
1550
|
-
te(
|
|
1554
|
+
label: S().t("archbase:Lembre-me"),
|
|
1555
|
+
checked: U,
|
|
1556
|
+
onChange: (a) => {
|
|
1557
|
+
const h = a.currentTarget.checked;
|
|
1558
|
+
te(h), h || _();
|
|
1551
1559
|
}
|
|
1552
1560
|
}
|
|
1553
1561
|
),
|
|
1554
1562
|
t && /* @__PURE__ */ o(
|
|
1555
|
-
|
|
1563
|
+
rt,
|
|
1556
1564
|
{
|
|
1557
1565
|
component: "button",
|
|
1558
1566
|
c: "var(--mantine-text-color)",
|
|
@@ -1560,170 +1568,170 @@ function qr({
|
|
|
1560
1568
|
lh: "20px",
|
|
1561
1569
|
styles: { root: { cursor: "pointer" } },
|
|
1562
1570
|
onClick: t,
|
|
1563
|
-
children:
|
|
1571
|
+
children: S().t("archbase:Esqueci minha senha")
|
|
1564
1572
|
}
|
|
1565
1573
|
)
|
|
1566
1574
|
] }),
|
|
1567
|
-
|
|
1575
|
+
g?.afterInputs || c,
|
|
1568
1576
|
/* @__PURE__ */ o(
|
|
1569
|
-
|
|
1577
|
+
W,
|
|
1570
1578
|
{
|
|
1571
|
-
disabled: !N || !
|
|
1579
|
+
disabled: !N || !H || u,
|
|
1572
1580
|
fullWidth: !0,
|
|
1573
1581
|
mt: "xl",
|
|
1574
1582
|
onClick: $,
|
|
1575
|
-
children:
|
|
1583
|
+
children: S().t("archbase:signIn")
|
|
1576
1584
|
}
|
|
1577
1585
|
)
|
|
1578
1586
|
] }),
|
|
1579
|
-
|
|
1580
|
-
|
|
1587
|
+
g?.customContentAfter,
|
|
1588
|
+
ae && e && /* @__PURE__ */ o(j, { c: "red", mt: "sm", children: e })
|
|
1581
1589
|
]
|
|
1582
1590
|
}
|
|
1583
1591
|
);
|
|
1584
1592
|
}
|
|
1585
|
-
const
|
|
1586
|
-
function
|
|
1593
|
+
const z = (r, e) => S().t(r, e);
|
|
1594
|
+
function Xr({
|
|
1587
1595
|
enabled: r,
|
|
1588
1596
|
onSetup: e,
|
|
1589
1597
|
onEnable: t,
|
|
1590
1598
|
onDisable: s,
|
|
1591
1599
|
onStatusChange: n
|
|
1592
1600
|
}) {
|
|
1593
|
-
const [
|
|
1594
|
-
|
|
1601
|
+
const [c, l] = p("idle"), [i, d] = p(null), [g, k] = p(""), [u, T] = p([]), [b, v] = p(!1), [E, P] = p(null), M = async () => {
|
|
1602
|
+
v(!0), P(null);
|
|
1595
1603
|
try {
|
|
1596
|
-
const
|
|
1597
|
-
d(
|
|
1598
|
-
} catch (
|
|
1599
|
-
P(
|
|
1604
|
+
const w = await e();
|
|
1605
|
+
d(w), k(""), l("setup");
|
|
1606
|
+
} catch (w) {
|
|
1607
|
+
P(w?.message || String(w));
|
|
1600
1608
|
} finally {
|
|
1601
|
-
|
|
1609
|
+
v(!1);
|
|
1602
1610
|
}
|
|
1603
1611
|
}, B = async () => {
|
|
1604
|
-
const
|
|
1605
|
-
if (
|
|
1606
|
-
|
|
1612
|
+
const w = g.trim();
|
|
1613
|
+
if (w) {
|
|
1614
|
+
v(!0), P(null);
|
|
1607
1615
|
try {
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1610
|
-
} catch (
|
|
1611
|
-
P(
|
|
1616
|
+
const f = await t(w);
|
|
1617
|
+
T(f), l("recovery"), n?.(!0);
|
|
1618
|
+
} catch (f) {
|
|
1619
|
+
P(f?.message || String(f));
|
|
1612
1620
|
} finally {
|
|
1613
|
-
|
|
1621
|
+
v(!1);
|
|
1614
1622
|
}
|
|
1615
1623
|
}
|
|
1616
|
-
},
|
|
1617
|
-
|
|
1624
|
+
}, F = async () => {
|
|
1625
|
+
v(!0), P(null);
|
|
1618
1626
|
try {
|
|
1619
|
-
await s(), d(null),
|
|
1620
|
-
} catch (
|
|
1621
|
-
P(
|
|
1627
|
+
await s(), d(null), T([]), l("idle"), n?.(!1);
|
|
1628
|
+
} catch (w) {
|
|
1629
|
+
P(w?.message || String(w));
|
|
1622
1630
|
} finally {
|
|
1623
|
-
|
|
1631
|
+
v(!1);
|
|
1624
1632
|
}
|
|
1625
|
-
},
|
|
1626
|
-
|
|
1633
|
+
}, D = () => {
|
|
1634
|
+
T([]), d(null), k(""), l("idle");
|
|
1627
1635
|
};
|
|
1628
|
-
return /* @__PURE__ */ o(
|
|
1636
|
+
return /* @__PURE__ */ o(Je, { withBorder: !0, radius: "md", p: "lg", children: /* @__PURE__ */ C(xe, { gap: "md", children: [
|
|
1629
1637
|
/* @__PURE__ */ C("div", { children: [
|
|
1630
|
-
/* @__PURE__ */ o(j, { fw: 700, fz: "lg", children:
|
|
1631
|
-
/* @__PURE__ */ o(j, { c: "dimmed", fz: "sm", children:
|
|
1638
|
+
/* @__PURE__ */ o(j, { fw: 700, fz: "lg", children: z("archbase:mfa.setup.title", "Autenticação em duas etapas (MFA)") }),
|
|
1639
|
+
/* @__PURE__ */ o(j, { c: "dimmed", fz: "sm", children: z(
|
|
1632
1640
|
"archbase:mfa.setup.subtitle",
|
|
1633
1641
|
"Proteja o acesso exigindo um código do seu aplicativo autenticador no login."
|
|
1634
1642
|
) })
|
|
1635
1643
|
] }),
|
|
1636
|
-
E && /* @__PURE__ */ o(
|
|
1637
|
-
r &&
|
|
1638
|
-
/* @__PURE__ */ o(j, { c: "teal", fw: 600, children:
|
|
1639
|
-
/* @__PURE__ */ o(
|
|
1644
|
+
E && /* @__PURE__ */ o(st, { color: "red", children: E }),
|
|
1645
|
+
r && c === "idle" && /* @__PURE__ */ C(ue, { justify: "space-between", children: [
|
|
1646
|
+
/* @__PURE__ */ o(j, { c: "teal", fw: 600, children: z("archbase:mfa.setup.active", "MFA ativo") }),
|
|
1647
|
+
/* @__PURE__ */ o(W, { color: "red", variant: "light", loading: b, onClick: F, children: z("archbase:mfa.setup.disable", "Desativar") })
|
|
1640
1648
|
] }),
|
|
1641
|
-
!r &&
|
|
1642
|
-
|
|
1643
|
-
/* @__PURE__ */ o(j, { fz: "sm", ta: "center", children:
|
|
1649
|
+
!r && c === "idle" && /* @__PURE__ */ o(W, { loading: b, onClick: M, children: z("archbase:mfa.setup.enable", "Ativar MFA") }),
|
|
1650
|
+
c === "setup" && i && /* @__PURE__ */ C(xe, { gap: "sm", align: "center", children: [
|
|
1651
|
+
/* @__PURE__ */ o(j, { fz: "sm", ta: "center", children: z(
|
|
1644
1652
|
"archbase:mfa.setup.scan",
|
|
1645
1653
|
"Escaneie o QR Code no seu app autenticador (Google Authenticator, Authy…):"
|
|
1646
1654
|
) }),
|
|
1647
|
-
/* @__PURE__ */ o(
|
|
1648
|
-
/* @__PURE__ */ o(j, { fz: "xs", c: "dimmed", ta: "center", children:
|
|
1655
|
+
/* @__PURE__ */ o(nr, { value: i.provisioningUri, size: 180, level: "M" }),
|
|
1656
|
+
/* @__PURE__ */ o(j, { fz: "xs", c: "dimmed", ta: "center", children: z("archbase:mfa.setup.manual", "Ou informe o código manualmente:") }),
|
|
1649
1657
|
/* @__PURE__ */ C(ue, { gap: "xs", children: [
|
|
1650
|
-
/* @__PURE__ */ o(
|
|
1651
|
-
/* @__PURE__ */ o(
|
|
1658
|
+
/* @__PURE__ */ o(nt, { children: i.secret }),
|
|
1659
|
+
/* @__PURE__ */ o(ot, { value: i.secret, children: ({ copied: w, copy: f }) => /* @__PURE__ */ o(W, { size: "xs", variant: "subtle", onClick: f, children: w ? z("archbase:mfa.setup.copied", "Copiado") : z("archbase:mfa.setup.copy", "Copiar") }) })
|
|
1652
1660
|
] }),
|
|
1653
1661
|
/* @__PURE__ */ o(
|
|
1654
|
-
|
|
1662
|
+
Se,
|
|
1655
1663
|
{
|
|
1656
1664
|
w: "100%",
|
|
1657
|
-
label:
|
|
1665
|
+
label: z("archbase:mfa.setup.confirmCode", "Digite o código gerado para confirmar"),
|
|
1658
1666
|
placeholder: "000000",
|
|
1659
|
-
value:
|
|
1660
|
-
onChange: (
|
|
1661
|
-
onKeyDown: (
|
|
1662
|
-
|
|
1667
|
+
value: g,
|
|
1668
|
+
onChange: (w) => k(w.currentTarget.value),
|
|
1669
|
+
onKeyDown: (w) => {
|
|
1670
|
+
w.key === "Enter" && B();
|
|
1663
1671
|
}
|
|
1664
1672
|
}
|
|
1665
1673
|
),
|
|
1666
1674
|
/* @__PURE__ */ C(ue, { w: "100%", justify: "flex-end", children: [
|
|
1667
|
-
/* @__PURE__ */ o(
|
|
1668
|
-
/* @__PURE__ */ o(
|
|
1675
|
+
/* @__PURE__ */ o(W, { variant: "default", onClick: D, disabled: b, children: z("archbase:mfa.setup.cancel", "Cancelar") }),
|
|
1676
|
+
/* @__PURE__ */ o(W, { onClick: B, loading: b, disabled: !g.trim(), children: z("archbase:mfa.setup.confirm", "Confirmar e ativar") })
|
|
1669
1677
|
] })
|
|
1670
1678
|
] }),
|
|
1671
|
-
|
|
1672
|
-
/* @__PURE__ */ o(
|
|
1679
|
+
c === "recovery" && /* @__PURE__ */ C(xe, { gap: "sm", children: [
|
|
1680
|
+
/* @__PURE__ */ o(st, { color: "yellow", children: z(
|
|
1673
1681
|
"archbase:mfa.setup.recoveryWarning",
|
|
1674
1682
|
"Guarde estes códigos de recuperação em local seguro. Cada um funciona uma única vez e permite entrar se você perder o acesso ao app autenticador. Eles não serão exibidos novamente."
|
|
1675
1683
|
) }),
|
|
1676
|
-
/* @__PURE__ */ o(
|
|
1684
|
+
/* @__PURE__ */ o(er, { cols: 2, spacing: "xs", children: u.map((w) => /* @__PURE__ */ o(nt, { fz: "sm", children: w }, w)) }),
|
|
1677
1685
|
/* @__PURE__ */ C(ue, { justify: "space-between", children: [
|
|
1678
|
-
/* @__PURE__ */ o(
|
|
1679
|
-
`), children: ({ copied:
|
|
1680
|
-
/* @__PURE__ */ o(
|
|
1686
|
+
/* @__PURE__ */ o(ot, { value: u.join(`
|
|
1687
|
+
`), children: ({ copied: w, copy: f }) => /* @__PURE__ */ o(W, { variant: "subtle", onClick: f, children: w ? z("archbase:mfa.setup.copied", "Copiado") : z("archbase:mfa.setup.copyAll", "Copiar todos") }) }),
|
|
1688
|
+
/* @__PURE__ */ o(W, { onClick: D, children: z("archbase:mfa.setup.done", "Guardei os códigos") })
|
|
1681
1689
|
] })
|
|
1682
1690
|
] })
|
|
1683
1691
|
] }) });
|
|
1684
1692
|
}
|
|
1685
|
-
const
|
|
1693
|
+
const Ir = {
|
|
1686
1694
|
position: "relative",
|
|
1687
1695
|
width: "90%",
|
|
1688
1696
|
maxWidth: 400,
|
|
1689
1697
|
padding: 30,
|
|
1690
1698
|
marginTop: 30
|
|
1691
1699
|
};
|
|
1692
|
-
function
|
|
1693
|
-
const
|
|
1694
|
-
async function
|
|
1695
|
-
$ && (
|
|
1696
|
-
|
|
1700
|
+
function Qr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClickBackToLogin: s, validatePassword: n, validateToken: c, initialEmail: l = "", description: i, style: d, passwordPolicy: g, showPasswordRequirements: k = !0 }) {
|
|
1701
|
+
const u = ht(), T = Wt(), { colorScheme: b } = tr(), [v, E] = p(r ?? ""), [P, M] = p(l), [B, F] = p(""), [D, w] = p(""), [f, _] = p(""), [H, L] = p(!1), [N, X] = p(""), [U, te] = p(""), [ae, m] = p(""), [y, J] = p(""), V = Gt(g);
|
|
1702
|
+
async function be($) {
|
|
1703
|
+
$ && (Jt($) ? await e($).then(() => {
|
|
1704
|
+
it.showSuccess(`${S().t("archbase:Um e-mail com instruções para redefinir sua senha foi enviado. Verifique sua caixa de entrada.")}`), L(!0);
|
|
1697
1705
|
}).catch(() => {
|
|
1698
|
-
}) :
|
|
1706
|
+
}) : X(`${S().t("archbase:Email inválido")}`));
|
|
1699
1707
|
}
|
|
1700
|
-
async function he($, ce, ne,
|
|
1708
|
+
async function he($, ce, ne, Ae) {
|
|
1701
1709
|
if ($ && ce && ne) {
|
|
1702
|
-
let
|
|
1703
|
-
|
|
1704
|
-
|
|
1710
|
+
let pe = "", a = "", h = "";
|
|
1711
|
+
c && (pe = c(ce), te(pe)), V && (a = Kt(ne, V).error ?? ""), !a && n && (a = n(ne)), m(a), ne !== Ae && (h = `${S().t("archbase:A nova senha e a confirmação devem ser iguais.")}`, J(h)), !a && !pe && !h && await t($, ce, ne).then(() => {
|
|
1712
|
+
it.showSuccess(`${S().t("archbase:Senha redefinida com sucesso.")}`), s(), L(!1);
|
|
1705
1713
|
}).catch(() => {
|
|
1706
|
-
E(r || `${
|
|
1714
|
+
E(r || `${S().t("archbase:Erro ao redefinir senha.")}`);
|
|
1707
1715
|
});
|
|
1708
1716
|
}
|
|
1709
1717
|
}
|
|
1710
|
-
return
|
|
1718
|
+
return Y(() => {
|
|
1711
1719
|
r && E(r);
|
|
1712
|
-
}, [r]),
|
|
1720
|
+
}, [r]), Y(() => {
|
|
1713
1721
|
E("");
|
|
1714
|
-
}, [P, B,
|
|
1715
|
-
|
|
1722
|
+
}, [P, B, D, f]), /* @__PURE__ */ C(
|
|
1723
|
+
Je,
|
|
1716
1724
|
{
|
|
1717
1725
|
withBorder: !0,
|
|
1718
1726
|
shadow: "md",
|
|
1719
1727
|
radius: "md",
|
|
1720
|
-
ref:
|
|
1728
|
+
ref: u,
|
|
1721
1729
|
style: {
|
|
1722
|
-
...
|
|
1730
|
+
...Ir,
|
|
1723
1731
|
...d
|
|
1724
1732
|
},
|
|
1725
1733
|
children: [
|
|
1726
|
-
|
|
1734
|
+
H ? /* @__PURE__ */ C(ie, { children: [
|
|
1727
1735
|
/* @__PURE__ */ o(
|
|
1728
1736
|
j,
|
|
1729
1737
|
{
|
|
@@ -1732,77 +1740,77 @@ function Xr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClick
|
|
|
1732
1740
|
fz: { base: "20px", md: "35px" },
|
|
1733
1741
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1734
1742
|
mt: "xs",
|
|
1735
|
-
children:
|
|
1743
|
+
children: S().t("archbase:Redefinir senha")
|
|
1736
1744
|
}
|
|
1737
1745
|
),
|
|
1738
|
-
/* @__PURE__ */ o(
|
|
1746
|
+
/* @__PURE__ */ o(De, { m: "xs" }),
|
|
1739
1747
|
/* @__PURE__ */ o(
|
|
1740
|
-
|
|
1748
|
+
Se,
|
|
1741
1749
|
{
|
|
1742
|
-
label:
|
|
1743
|
-
placeholder: `${
|
|
1750
|
+
label: S().t("archbase:Código de segurança"),
|
|
1751
|
+
placeholder: `${S().t("archbase:Código enviado no seu e-mail")}`,
|
|
1744
1752
|
value: B || "",
|
|
1745
1753
|
required: !0,
|
|
1746
1754
|
onChange: ($) => {
|
|
1747
|
-
|
|
1755
|
+
F($.currentTarget.value), te("");
|
|
1748
1756
|
},
|
|
1749
|
-
error:
|
|
1757
|
+
error: U
|
|
1750
1758
|
}
|
|
1751
1759
|
),
|
|
1752
1760
|
/* @__PURE__ */ o(
|
|
1753
|
-
|
|
1761
|
+
je,
|
|
1754
1762
|
{
|
|
1755
|
-
label:
|
|
1756
|
-
placeholder:
|
|
1763
|
+
label: S().t("archbase:Nova senha"),
|
|
1764
|
+
placeholder: S().t("archbase:Nova senha"),
|
|
1757
1765
|
onChange: ($) => {
|
|
1758
|
-
|
|
1766
|
+
w($.currentTarget.value), m(""), J("");
|
|
1759
1767
|
},
|
|
1760
|
-
value:
|
|
1768
|
+
value: D,
|
|
1761
1769
|
required: !0,
|
|
1762
|
-
error:
|
|
1770
|
+
error: ae
|
|
1763
1771
|
}
|
|
1764
1772
|
),
|
|
1765
|
-
|
|
1766
|
-
|
|
1773
|
+
V && /* @__PURE__ */ o(
|
|
1774
|
+
or,
|
|
1767
1775
|
{
|
|
1768
|
-
value:
|
|
1769
|
-
policy:
|
|
1776
|
+
value: D,
|
|
1777
|
+
policy: V,
|
|
1770
1778
|
showRequirements: k
|
|
1771
1779
|
}
|
|
1772
1780
|
),
|
|
1773
1781
|
/* @__PURE__ */ o(
|
|
1774
|
-
|
|
1782
|
+
je,
|
|
1775
1783
|
{
|
|
1776
|
-
label:
|
|
1777
|
-
placeholder:
|
|
1784
|
+
label: S().t("archbase:Confirmar senha"),
|
|
1785
|
+
placeholder: S().t("archbase:Confirmar senha"),
|
|
1778
1786
|
onChange: ($) => {
|
|
1779
|
-
|
|
1787
|
+
_($.currentTarget.value), J("");
|
|
1780
1788
|
},
|
|
1781
|
-
value:
|
|
1789
|
+
value: f || "",
|
|
1782
1790
|
required: !0,
|
|
1783
|
-
error:
|
|
1791
|
+
error: y
|
|
1784
1792
|
}
|
|
1785
1793
|
),
|
|
1786
1794
|
/* @__PURE__ */ o(
|
|
1787
|
-
|
|
1795
|
+
W,
|
|
1788
1796
|
{
|
|
1789
|
-
disabled: !P || !B || !
|
|
1797
|
+
disabled: !P || !B || !D || !f,
|
|
1790
1798
|
mt: "md",
|
|
1791
1799
|
fullWidth: !0,
|
|
1792
|
-
onClick: () => he(P, B,
|
|
1793
|
-
children: `${
|
|
1800
|
+
onClick: () => he(P, B, D, f),
|
|
1801
|
+
children: `${S().t("archbase:Redefinir senha")}`
|
|
1794
1802
|
}
|
|
1795
1803
|
),
|
|
1796
1804
|
/* @__PURE__ */ o(
|
|
1797
|
-
|
|
1805
|
+
W,
|
|
1798
1806
|
{
|
|
1799
1807
|
mt: "6px",
|
|
1800
1808
|
fullWidth: !0,
|
|
1801
|
-
color:
|
|
1809
|
+
color: b === "dark" ? T.colors.dark[4] : T.colors.gray[7],
|
|
1802
1810
|
onClick: () => {
|
|
1803
1811
|
N || L(!1);
|
|
1804
1812
|
},
|
|
1805
|
-
children: `${
|
|
1813
|
+
children: `${S().t("archbase:Voltar")}`
|
|
1806
1814
|
}
|
|
1807
1815
|
)
|
|
1808
1816
|
] }) : /* @__PURE__ */ C(ie, { children: [
|
|
@@ -1814,264 +1822,268 @@ function Xr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClick
|
|
|
1814
1822
|
fz: { base: "20px", md: "35px" },
|
|
1815
1823
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1816
1824
|
mt: "xs",
|
|
1817
|
-
children:
|
|
1825
|
+
children: S().t("archbase:Redefinir senha")
|
|
1818
1826
|
}
|
|
1819
1827
|
),
|
|
1820
1828
|
/* @__PURE__ */ o(j, { c: "dimmed", fz: 14, style: { textAlign: "justify" }, children: i }),
|
|
1821
|
-
/* @__PURE__ */ o(
|
|
1829
|
+
/* @__PURE__ */ o(De, { m: "md" }),
|
|
1822
1830
|
/* @__PURE__ */ o(
|
|
1823
|
-
|
|
1831
|
+
Se,
|
|
1824
1832
|
{
|
|
1825
1833
|
label: "Email",
|
|
1826
|
-
placeholder: `${
|
|
1834
|
+
placeholder: `${S().t("archbase:usuario@email.com")}`,
|
|
1827
1835
|
value: P || "",
|
|
1828
1836
|
required: !0,
|
|
1829
1837
|
onChange: ($) => {
|
|
1830
|
-
M($.currentTarget.value),
|
|
1838
|
+
M($.currentTarget.value), X("");
|
|
1831
1839
|
},
|
|
1832
1840
|
error: N
|
|
1833
1841
|
}
|
|
1834
1842
|
),
|
|
1835
1843
|
/* @__PURE__ */ o(
|
|
1836
|
-
|
|
1844
|
+
W,
|
|
1837
1845
|
{
|
|
1838
1846
|
disabled: !P,
|
|
1839
1847
|
mt: "md",
|
|
1840
1848
|
fullWidth: !0,
|
|
1841
|
-
onClick: () =>
|
|
1842
|
-
children: `${
|
|
1849
|
+
onClick: () => be(P),
|
|
1850
|
+
children: `${S().t("archbase:Enviar")}`
|
|
1843
1851
|
}
|
|
1844
1852
|
),
|
|
1845
1853
|
/* @__PURE__ */ o(
|
|
1846
|
-
|
|
1854
|
+
W,
|
|
1847
1855
|
{
|
|
1848
1856
|
mt: "6px",
|
|
1849
1857
|
fullWidth: !0,
|
|
1850
|
-
color:
|
|
1858
|
+
color: b === "dark" ? T.colors.dark[4] : T.colors.gray[7],
|
|
1851
1859
|
onClick: () => s && s(),
|
|
1852
|
-
children: `${
|
|
1860
|
+
children: `${S().t("archbase:Voltar")}`
|
|
1853
1861
|
}
|
|
1854
1862
|
)
|
|
1855
1863
|
] }),
|
|
1856
|
-
|
|
1864
|
+
v ? /* @__PURE__ */ o(j, { c: "red", style: { textAlign: "justify" }, children: v }) : null
|
|
1857
1865
|
]
|
|
1858
1866
|
}
|
|
1859
1867
|
);
|
|
1860
1868
|
}
|
|
1861
|
-
const
|
|
1862
|
-
const s =
|
|
1869
|
+
const Cr = () => qt().user, Nt = "archbaseSecurityManagerStore", Zr = ({ resourceName: r, resourceDescription: e, enableSecurity: t = !0 }) => {
|
|
1870
|
+
const s = dt(Nt), n = Cr(), c = n?.isAdmin ?? !1, l = n?.id, i = We(l), d = lt(() => {
|
|
1863
1871
|
if (!t)
|
|
1864
1872
|
return null;
|
|
1865
|
-
const
|
|
1866
|
-
if (s && s.existsValue(
|
|
1867
|
-
const
|
|
1868
|
-
if (
|
|
1869
|
-
return
|
|
1873
|
+
const g = l ? `${r}_${l}` : r;
|
|
1874
|
+
if (s && s.existsValue(g)) {
|
|
1875
|
+
const u = s.getValue(g);
|
|
1876
|
+
if (u && u.isAdmin === c)
|
|
1877
|
+
return u;
|
|
1870
1878
|
}
|
|
1871
|
-
const k = new
|
|
1872
|
-
return s &&
|
|
1873
|
-
}, [t, r, e,
|
|
1874
|
-
return
|
|
1875
|
-
i.current =
|
|
1876
|
-
}, [
|
|
1879
|
+
const k = new wt(r, e, c);
|
|
1880
|
+
return s && l && s.setValue(g, k), k;
|
|
1881
|
+
}, [t, r, e, c, l]);
|
|
1882
|
+
return Y(() => {
|
|
1883
|
+
i.current = l;
|
|
1884
|
+
}, [l]), { securityManager: d };
|
|
1877
1885
|
};
|
|
1878
|
-
function
|
|
1886
|
+
function ze(r) {
|
|
1879
1887
|
const e = r?.response?.data ?? r?.data ?? r;
|
|
1880
1888
|
return e?.error === "CREDENTIALS_EXPIRED" || e?.requirePasswordChange === !0;
|
|
1881
1889
|
}
|
|
1882
|
-
const
|
|
1890
|
+
const es = ({
|
|
1883
1891
|
checkIntervalTokenHasExpired: r = 3e4,
|
|
1884
1892
|
// Verificar a 30 segundos
|
|
1885
1893
|
expirationThresholdOfToken: e = 300
|
|
1886
1894
|
// Antecipar em 5 minutos
|
|
1887
1895
|
}) => {
|
|
1888
|
-
const t =
|
|
1889
|
-
(
|
|
1890
|
-
), s =
|
|
1891
|
-
(
|
|
1892
|
-
), [n,
|
|
1896
|
+
const t = _e(
|
|
1897
|
+
(a) => a.get(q.TokenManager)
|
|
1898
|
+
), s = _e(
|
|
1899
|
+
(a) => a.get(q.Authenticator)
|
|
1900
|
+
), [n, c] = p(null), [l, i] = p(!1), [d, g] = p(!0), [k, u] = p(!1), [T, b] = p(!1), [v, E] = p(""), [P, M] = p(""), [B, F] = p(null), [D, w] = p(!1), [f, _] = p(!1), [H, L] = p(null), N = We(!1), X = dt(Nt), U = {
|
|
1893
1901
|
hasContextualLogin: typeof s.loginWithContext == "function",
|
|
1894
1902
|
hasFlexibleLogin: typeof s.loginFlexible == "function",
|
|
1895
1903
|
hasSocialLogin: typeof s.loginSocial == "function",
|
|
1896
1904
|
hasRegistration: typeof s.register == "function",
|
|
1897
1905
|
hasContextSupport: typeof t.saveContext == "function"
|
|
1898
1906
|
};
|
|
1899
|
-
|
|
1900
|
-
const
|
|
1901
|
-
if (
|
|
1902
|
-
const
|
|
1903
|
-
if (
|
|
1907
|
+
Y(() => {
|
|
1908
|
+
const a = t.getUsername();
|
|
1909
|
+
if (a && a != "" && M(a), U.hasContextSupport && t.getContext) {
|
|
1910
|
+
const x = t.getContext();
|
|
1911
|
+
if (x)
|
|
1904
1912
|
try {
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
} catch (
|
|
1908
|
-
console.warn("Erro ao carregar contexto salvo:",
|
|
1913
|
+
const R = typeof x == "string" ? JSON.parse(x) : x;
|
|
1914
|
+
F(R);
|
|
1915
|
+
} catch (R) {
|
|
1916
|
+
console.warn("Erro ao carregar contexto salvo:", R);
|
|
1909
1917
|
}
|
|
1910
1918
|
}
|
|
1911
|
-
const
|
|
1912
|
-
|
|
1919
|
+
const h = t.getToken();
|
|
1920
|
+
h && (u(!0), E(""), b(!1), c(h)), g(!1);
|
|
1913
1921
|
}, []);
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
},
|
|
1917
|
-
|
|
1918
|
-
},
|
|
1919
|
-
i(!1),
|
|
1920
|
-
},
|
|
1922
|
+
const te = () => {
|
|
1923
|
+
b(!1), E("");
|
|
1924
|
+
}, ae = () => {
|
|
1925
|
+
_(!1);
|
|
1926
|
+
}, m = (a) => {
|
|
1927
|
+
i(!1), u(!1), c(null), t.clearToken(), a && t.clearUsernameAndPassword(), U.hasContextSupport && t.clearContext && t.clearContext(), M(""), F(null), E(""), b(!1), _(!1), X.clearAllValues();
|
|
1928
|
+
}, y = async (a, h, x) => {
|
|
1921
1929
|
try {
|
|
1922
|
-
i(!0),
|
|
1923
|
-
const
|
|
1924
|
-
t.saveToken(
|
|
1925
|
-
} catch (
|
|
1926
|
-
i(!1),
|
|
1930
|
+
i(!0), u(!1);
|
|
1931
|
+
const R = await s.login(a, h);
|
|
1932
|
+
t.saveToken(R), x && t.saveUsernameAndPassword(a, h), t.saveUsername(a), M(a), c(R), i(!1), u(!0);
|
|
1933
|
+
} catch (R) {
|
|
1934
|
+
i(!1), u(!1), ze(R) && (M(a), _(!0)), E(oe(R)), b(!0);
|
|
1927
1935
|
}
|
|
1928
|
-
},
|
|
1929
|
-
if (!
|
|
1936
|
+
}, J = async (a, h = !1) => {
|
|
1937
|
+
if (!U.hasContextualLogin || !s.loginWithContext)
|
|
1930
1938
|
throw new Error("Login contextual não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1931
1939
|
try {
|
|
1932
|
-
i(!0),
|
|
1933
|
-
const { context:
|
|
1934
|
-
if (
|
|
1935
|
-
L(
|
|
1940
|
+
i(!0), u(!1);
|
|
1941
|
+
const { context: x, user: R, ...re } = await s.loginWithContext(a);
|
|
1942
|
+
if (re.mfa_required) {
|
|
1943
|
+
L(re.challenge_token ?? null), w(!0), M(a.email), i(!1);
|
|
1936
1944
|
return;
|
|
1937
1945
|
}
|
|
1938
|
-
const
|
|
1946
|
+
const Ee = {
|
|
1939
1947
|
scope: "",
|
|
1940
|
-
ext_expires_in:
|
|
1941
|
-
...
|
|
1948
|
+
ext_expires_in: re.expires_in,
|
|
1949
|
+
...re
|
|
1942
1950
|
};
|
|
1943
|
-
t.saveToken(
|
|
1944
|
-
} catch (
|
|
1945
|
-
throw i(!1),
|
|
1951
|
+
t.saveToken(Ee), h ? t.saveUsernameAndPassword(a.email, a.password) : t.clearUsernameAndPassword(), t.saveUsername(a.email), U.hasContextSupport && t.saveContext && x && (t.saveContext(JSON.stringify(x)), F(x)), M(a.email), c(Ee), i(!1), u(!0);
|
|
1952
|
+
} catch (x) {
|
|
1953
|
+
throw i(!1), u(!1), ze(x) && (M(a.email), _(!0)), E(oe(x)), b(!0), x;
|
|
1946
1954
|
}
|
|
1947
|
-
},
|
|
1955
|
+
}, V = async (a) => {
|
|
1948
1956
|
if (!s.verifyMfa)
|
|
1949
1957
|
throw new Error("verifyMfa não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1950
|
-
if (!
|
|
1958
|
+
if (!H)
|
|
1951
1959
|
throw new Error("Nenhum desafio de MFA pendente");
|
|
1952
1960
|
try {
|
|
1953
|
-
i(!0), E(""),
|
|
1954
|
-
const
|
|
1955
|
-
t.saveToken(
|
|
1956
|
-
} catch (
|
|
1957
|
-
throw i(!1), E(oe(
|
|
1961
|
+
i(!0), E(""), b(!1);
|
|
1962
|
+
const h = await s.verifyMfa(H, a);
|
|
1963
|
+
t.saveToken(h), t.saveUsername(P), c(h), w(!1), L(null), i(!1), u(!0);
|
|
1964
|
+
} catch (h) {
|
|
1965
|
+
throw i(!1), E(oe(h)), b(!0), h;
|
|
1958
1966
|
}
|
|
1959
|
-
},
|
|
1960
|
-
|
|
1961
|
-
},
|
|
1962
|
-
if (!
|
|
1967
|
+
}, be = () => {
|
|
1968
|
+
w(!1), L(null), E(""), b(!1);
|
|
1969
|
+
}, he = async (a, h = !1) => {
|
|
1970
|
+
if (!U.hasFlexibleLogin || !s.loginFlexible)
|
|
1963
1971
|
throw new Error("Login flexível não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1964
1972
|
try {
|
|
1965
|
-
i(!0),
|
|
1966
|
-
const { context:
|
|
1973
|
+
i(!0), u(!1);
|
|
1974
|
+
const { context: x, user: R, ...re } = await s.loginFlexible(a), Ee = {
|
|
1967
1975
|
scope: "",
|
|
1968
|
-
ext_expires_in:
|
|
1969
|
-
...
|
|
1976
|
+
ext_expires_in: re.expires_in,
|
|
1977
|
+
...re
|
|
1970
1978
|
};
|
|
1971
|
-
t.saveToken(
|
|
1972
|
-
} catch (
|
|
1973
|
-
throw i(!1),
|
|
1979
|
+
t.saveToken(Ee), h && t.saveUsernameAndPassword(a.identifier, a.password), t.saveUsername(R.email || a.identifier), U.hasContextSupport && t.saveContext && x && (t.saveContext(JSON.stringify(x)), F(x)), M(R.email || a.identifier), c(Ee), i(!1), u(!0);
|
|
1980
|
+
} catch (x) {
|
|
1981
|
+
throw i(!1), u(!1), ze(x) && (M(a.identifier), _(!0)), E(oe(x)), b(!0), x;
|
|
1974
1982
|
}
|
|
1975
|
-
},
|
|
1976
|
-
if (!
|
|
1983
|
+
}, $ = async (a) => {
|
|
1984
|
+
if (!U.hasSocialLogin || !s.loginSocial)
|
|
1977
1985
|
throw new Error("Login social não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1978
1986
|
try {
|
|
1979
|
-
i(!0),
|
|
1980
|
-
const { context:
|
|
1987
|
+
i(!0), u(!1);
|
|
1988
|
+
const { context: h, user: x, ...R } = await s.loginSocial(a), re = {
|
|
1981
1989
|
scope: "",
|
|
1982
|
-
ext_expires_in:
|
|
1983
|
-
...
|
|
1990
|
+
ext_expires_in: R.expires_in,
|
|
1991
|
+
...R
|
|
1984
1992
|
};
|
|
1985
|
-
t.saveToken(
|
|
1986
|
-
} catch (
|
|
1987
|
-
throw i(!1),
|
|
1993
|
+
t.saveToken(re), t.saveUsername(x.email), U.hasContextSupport && t.saveContext && h && (t.saveContext(JSON.stringify(h)), F(h)), M(x.email), c(re), i(!1), u(!0);
|
|
1994
|
+
} catch (h) {
|
|
1995
|
+
throw i(!1), u(!1), E(oe(h)), b(!0), h;
|
|
1988
1996
|
}
|
|
1989
|
-
},
|
|
1990
|
-
if (!
|
|
1997
|
+
}, ce = async (a) => {
|
|
1998
|
+
if (!U.hasRegistration || !s.register)
|
|
1991
1999
|
throw new Error("Registro não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1992
2000
|
try {
|
|
1993
2001
|
i(!0);
|
|
1994
|
-
const
|
|
1995
|
-
return i(!1),
|
|
1996
|
-
} catch (
|
|
1997
|
-
throw i(!1), E(oe(
|
|
2002
|
+
const h = await s.register(a);
|
|
2003
|
+
return i(!1), h;
|
|
2004
|
+
} catch (h) {
|
|
2005
|
+
throw i(!1), E(oe(h)), b(!0), h;
|
|
1998
2006
|
}
|
|
1999
|
-
},
|
|
2000
|
-
|
|
2001
|
-
const
|
|
2002
|
-
n && n.access_token && t.isTokenExpired(n, e) &&
|
|
2007
|
+
}, ne = async () => s.getSupportedContexts ? await s.getSupportedContexts() : { supportedContexts: ["DEFAULT"], defaultContext: "DEFAULT" }, Ae = async (a) => s.validateContext ? await s.validateContext(a) : { context: a, supported: a === "DEFAULT" };
|
|
2008
|
+
Y(() => {
|
|
2009
|
+
const a = setInterval(() => {
|
|
2010
|
+
n && n.access_token && t.isTokenExpired(n, e) && pe();
|
|
2003
2011
|
}, r);
|
|
2004
2012
|
return () => {
|
|
2005
|
-
clearInterval(
|
|
2013
|
+
clearInterval(a);
|
|
2006
2014
|
};
|
|
2007
2015
|
}, [n]);
|
|
2008
|
-
const
|
|
2009
|
-
if (n)
|
|
2016
|
+
const pe = async () => {
|
|
2017
|
+
if (n && !N.current) {
|
|
2018
|
+
N.current = !0;
|
|
2010
2019
|
try {
|
|
2011
|
-
const
|
|
2012
|
-
t.saveToken(
|
|
2013
|
-
} catch (
|
|
2014
|
-
console.error("Erro ao renovar o token:",
|
|
2020
|
+
const a = await s.refreshToken(n?.refresh_token);
|
|
2021
|
+
t.saveToken(a), c(a);
|
|
2022
|
+
} catch (a) {
|
|
2023
|
+
console.error("Erro ao renovar o token:", a), m();
|
|
2024
|
+
} finally {
|
|
2025
|
+
N.current = !1;
|
|
2015
2026
|
}
|
|
2027
|
+
}
|
|
2016
2028
|
};
|
|
2017
2029
|
return {
|
|
2018
2030
|
// Métodos básicos (compatibilidade)
|
|
2019
|
-
login:
|
|
2020
|
-
logout:
|
|
2031
|
+
login: y,
|
|
2032
|
+
logout: m,
|
|
2021
2033
|
username: P,
|
|
2022
2034
|
isAuthenticated: k,
|
|
2023
|
-
isAuthenticating:
|
|
2035
|
+
isAuthenticating: l,
|
|
2024
2036
|
isInitializing: d,
|
|
2025
|
-
isError:
|
|
2026
|
-
error:
|
|
2027
|
-
clearError:
|
|
2037
|
+
isError: T,
|
|
2038
|
+
error: v,
|
|
2039
|
+
clearError: te,
|
|
2028
2040
|
accessToken: n ? n.access_token : null,
|
|
2029
2041
|
// Métodos opcionais para autenticação avançada
|
|
2030
|
-
loginWithContext:
|
|
2031
|
-
loginFlexible:
|
|
2032
|
-
loginSocial:
|
|
2033
|
-
register:
|
|
2034
|
-
getSupportedContexts:
|
|
2035
|
-
validateContext:
|
|
2042
|
+
loginWithContext: U.hasContextualLogin ? J : void 0,
|
|
2043
|
+
loginFlexible: U.hasFlexibleLogin ? he : void 0,
|
|
2044
|
+
loginSocial: U.hasSocialLogin ? $ : void 0,
|
|
2045
|
+
register: U.hasRegistration ? ce : void 0,
|
|
2046
|
+
getSupportedContexts: ne,
|
|
2047
|
+
validateContext: Ae,
|
|
2036
2048
|
// MFA / segundo fator (2 passos)
|
|
2037
|
-
mfaRequired:
|
|
2038
|
-
verifyMfa: typeof s.verifyMfa == "function" ?
|
|
2039
|
-
cancelMfa:
|
|
2049
|
+
mfaRequired: D,
|
|
2050
|
+
verifyMfa: typeof s.verifyMfa == "function" ? V : void 0,
|
|
2051
|
+
cancelMfa: be,
|
|
2040
2052
|
// Troca de senha obrigatória (CREDENTIALS_EXPIRED)
|
|
2041
|
-
passwordChangeRequired:
|
|
2042
|
-
clearPasswordChangeRequired:
|
|
2053
|
+
passwordChangeRequired: f,
|
|
2054
|
+
clearPasswordChangeRequired: ae,
|
|
2043
2055
|
// Informações de contexto
|
|
2044
2056
|
context: B,
|
|
2045
2057
|
// Detecção de capacidades
|
|
2046
|
-
capabilities:
|
|
2058
|
+
capabilities: U
|
|
2047
2059
|
};
|
|
2048
|
-
},
|
|
2049
|
-
const r =
|
|
2050
|
-
(s) => s.get(
|
|
2060
|
+
}, ts = () => {
|
|
2061
|
+
const r = _e(
|
|
2062
|
+
(s) => s.get(q.TokenManager)
|
|
2051
2063
|
), [e, t] = p(null);
|
|
2052
|
-
return
|
|
2064
|
+
return Y(() => {
|
|
2053
2065
|
const s = r.getToken();
|
|
2054
2066
|
s && t(s.access_token);
|
|
2055
2067
|
}, []), {
|
|
2056
2068
|
token: e
|
|
2057
2069
|
};
|
|
2058
|
-
},
|
|
2059
|
-
const r =
|
|
2060
|
-
(d) => d.get(
|
|
2070
|
+
}, rs = () => {
|
|
2071
|
+
const r = _e(
|
|
2072
|
+
(d) => d.get(q.Authenticator)
|
|
2061
2073
|
), [e, t] = p(!1), [s, n] = p("");
|
|
2062
2074
|
return {
|
|
2063
2075
|
sendResetPasswordEmail: async (d) => {
|
|
2064
2076
|
try {
|
|
2065
2077
|
return await r.sendResetPasswordEmail(d);
|
|
2066
|
-
} catch (
|
|
2067
|
-
throw n(oe(
|
|
2078
|
+
} catch (g) {
|
|
2079
|
+
throw n(oe(g)), t(!0), g;
|
|
2068
2080
|
}
|
|
2069
2081
|
},
|
|
2070
|
-
resetPassword: async (d,
|
|
2082
|
+
resetPassword: async (d, g, k) => {
|
|
2071
2083
|
try {
|
|
2072
|
-
return await r.resetPassword(d,
|
|
2073
|
-
} catch (
|
|
2074
|
-
throw n(oe(
|
|
2084
|
+
return await r.resetPassword(d, g, k);
|
|
2085
|
+
} catch (u) {
|
|
2086
|
+
throw n(oe(u)), t(!0), u;
|
|
2075
2087
|
}
|
|
2076
2088
|
},
|
|
2077
2089
|
isError: e,
|
|
@@ -2080,77 +2092,77 @@ const Zr = ({
|
|
|
2080
2092
|
t(!1), n("");
|
|
2081
2093
|
}
|
|
2082
2094
|
};
|
|
2083
|
-
},
|
|
2095
|
+
}, Pr = () => /* @__PURE__ */ o(rr, { p: "xl", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ C(xe, { gap: "md", children: [
|
|
2084
2096
|
/* @__PURE__ */ C(ue, { gap: "sm", children: [
|
|
2085
|
-
/* @__PURE__ */ o(
|
|
2097
|
+
/* @__PURE__ */ o(ut, { size: "sm" }),
|
|
2086
2098
|
/* @__PURE__ */ o(j, { size: "sm", c: "dimmed", children: "Carregando permissões..." })
|
|
2087
2099
|
] }),
|
|
2088
|
-
/* @__PURE__ */ o(
|
|
2089
|
-
/* @__PURE__ */ o(
|
|
2100
|
+
/* @__PURE__ */ o(Pe, { height: 40, radius: "sm" }),
|
|
2101
|
+
/* @__PURE__ */ o(Pe, { height: 200, radius: "sm" }),
|
|
2090
2102
|
/* @__PURE__ */ C(ue, { gap: "md", children: [
|
|
2091
|
-
/* @__PURE__ */ o(
|
|
2092
|
-
/* @__PURE__ */ o(
|
|
2103
|
+
/* @__PURE__ */ o(Pe, { height: 36, width: 100, radius: "sm" }),
|
|
2104
|
+
/* @__PURE__ */ o(Pe, { height: 36, width: 100, radius: "sm" })
|
|
2093
2105
|
] })
|
|
2094
|
-
] }) }),
|
|
2106
|
+
] }) }), Qe = Ve(null), ss = ({
|
|
2095
2107
|
children: r,
|
|
2096
2108
|
user: e,
|
|
2097
2109
|
onError: t
|
|
2098
2110
|
}) => {
|
|
2099
|
-
const [s, n] = p(!1), [
|
|
2100
|
-
|
|
2101
|
-
}, [t]),
|
|
2111
|
+
const [s, n] = p(!1), [c, l] = p(null), [i] = p([]), d = e?.isAdministrator || !1, g = Ce((v) => d ? !0 : i.includes(v), [i, d]), k = Ce((v) => d ? !0 : v.some((E) => i.includes(E)), [i, d]), u = Ce((v) => d ? !0 : v.every((E) => i.includes(E)), [i, d]), T = Ce((v) => {
|
|
2112
|
+
l(v), v && t && t(v);
|
|
2113
|
+
}, [t]), b = {
|
|
2102
2114
|
user: e,
|
|
2103
2115
|
isLoading: s,
|
|
2104
|
-
hasGlobalPermission:
|
|
2116
|
+
hasGlobalPermission: g,
|
|
2105
2117
|
hasAnyGlobalPermission: k,
|
|
2106
|
-
hasAllGlobalPermissions:
|
|
2118
|
+
hasAllGlobalPermissions: u,
|
|
2107
2119
|
isAdmin: d,
|
|
2108
|
-
error:
|
|
2109
|
-
setError:
|
|
2120
|
+
error: c,
|
|
2121
|
+
setError: T
|
|
2110
2122
|
};
|
|
2111
|
-
return /* @__PURE__ */ o(
|
|
2112
|
-
},
|
|
2123
|
+
return /* @__PURE__ */ o(Qe.Provider, { value: b, children: r });
|
|
2124
|
+
}, $t = Ve(null), Tr = ({
|
|
2113
2125
|
children: r,
|
|
2114
2126
|
resourceName: e,
|
|
2115
2127
|
resourceDescription: t,
|
|
2116
2128
|
requiredPermissions: s = [],
|
|
2117
2129
|
fallbackComponent: n,
|
|
2118
|
-
loadingComponent:
|
|
2119
|
-
onSecurityReady:
|
|
2130
|
+
loadingComponent: c,
|
|
2131
|
+
onSecurityReady: l,
|
|
2120
2132
|
onError: i
|
|
2121
2133
|
}) => {
|
|
2122
|
-
const d =
|
|
2134
|
+
const d = Ge(Qe);
|
|
2123
2135
|
if (!d)
|
|
2124
2136
|
throw new Error("ArchbaseViewSecurityProvider deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
2125
|
-
const { user:
|
|
2126
|
-
if (
|
|
2127
|
-
if (!
|
|
2128
|
-
|
|
2137
|
+
const { user: g, isAdmin: k } = d, [u, T] = p(null), [b, v] = p(!0), [E, P] = p(null);
|
|
2138
|
+
if (ct.useEffect(() => {
|
|
2139
|
+
if (!g) {
|
|
2140
|
+
v(!1);
|
|
2129
2141
|
return;
|
|
2130
2142
|
}
|
|
2131
|
-
const
|
|
2143
|
+
const f = new wt(e, t, k);
|
|
2132
2144
|
(async () => {
|
|
2133
|
-
|
|
2145
|
+
v(!0);
|
|
2134
2146
|
try {
|
|
2135
|
-
await
|
|
2136
|
-
|
|
2147
|
+
await f.apply(() => {
|
|
2148
|
+
T(f), v(!1), l && l(f);
|
|
2137
2149
|
});
|
|
2138
2150
|
} catch {
|
|
2139
|
-
const L =
|
|
2140
|
-
P(L),
|
|
2151
|
+
const L = f.getError() || "Erro ao carregar permissões";
|
|
2152
|
+
P(L), v(!1), i && i(L);
|
|
2141
2153
|
}
|
|
2142
2154
|
})();
|
|
2143
|
-
}, [e, t,
|
|
2144
|
-
return
|
|
2155
|
+
}, [e, t, g, k, l, i]), b)
|
|
2156
|
+
return c ? /* @__PURE__ */ o(ie, { children: c }) : /* @__PURE__ */ o(Pr, {});
|
|
2145
2157
|
if (E)
|
|
2146
2158
|
return /* @__PURE__ */ o("div", { className: "archbase-security-error", children: /* @__PURE__ */ C("div", { children: [
|
|
2147
2159
|
"Erro ao carregar permissões: ",
|
|
2148
2160
|
E
|
|
2149
2161
|
] }) });
|
|
2150
|
-
if (!
|
|
2162
|
+
if (!g)
|
|
2151
2163
|
return n || /* @__PURE__ */ o("div", { className: "archbase-security-no-user", children: /* @__PURE__ */ o("div", { children: "É necessário fazer login para acessar esta área" }) });
|
|
2152
|
-
if (s.length > 0 &&
|
|
2153
|
-
(
|
|
2164
|
+
if (s.length > 0 && u && !s.every(
|
|
2165
|
+
(_) => u.hasPermission(_)
|
|
2154
2166
|
))
|
|
2155
2167
|
return n || /* @__PURE__ */ C("div", { className: "archbase-security-access-denied", children: [
|
|
2156
2168
|
/* @__PURE__ */ o("div", { children: "Você não possui permissão para acessar esta área" }),
|
|
@@ -2159,37 +2171,37 @@ const Zr = ({
|
|
|
2159
2171
|
s.join(", ")
|
|
2160
2172
|
] })
|
|
2161
2173
|
] });
|
|
2162
|
-
const
|
|
2163
|
-
securityManager:
|
|
2164
|
-
hasPermission: (
|
|
2165
|
-
hasAnyPermission: (
|
|
2166
|
-
hasAllPermissions: (
|
|
2167
|
-
registerAction: (
|
|
2168
|
-
|
|
2174
|
+
const w = {
|
|
2175
|
+
securityManager: u,
|
|
2176
|
+
hasPermission: (f) => u?.hasPermission(f) || !1,
|
|
2177
|
+
hasAnyPermission: (f) => f.some((_) => u?.hasPermission(_) || !1),
|
|
2178
|
+
hasAllPermissions: (f) => f.every((_) => u?.hasPermission(_) || !1),
|
|
2179
|
+
registerAction: (f, _) => {
|
|
2180
|
+
u?.registerAction(f, _);
|
|
2169
2181
|
},
|
|
2170
|
-
isLoading:
|
|
2182
|
+
isLoading: b,
|
|
2171
2183
|
error: E
|
|
2172
2184
|
};
|
|
2173
|
-
return /* @__PURE__ */ o(
|
|
2174
|
-
},
|
|
2175
|
-
const r =
|
|
2185
|
+
return /* @__PURE__ */ o($t.Provider, { value: w, children: r });
|
|
2186
|
+
}, Ur = () => {
|
|
2187
|
+
const r = Ge(Qe);
|
|
2176
2188
|
if (!r)
|
|
2177
2189
|
throw new Error("useArchbaseSecurity deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
2178
2190
|
return r;
|
|
2179
|
-
},
|
|
2180
|
-
const r =
|
|
2191
|
+
}, Ze = () => {
|
|
2192
|
+
const r = Ge($t);
|
|
2181
2193
|
if (!r)
|
|
2182
2194
|
throw new Error("useArchbaseViewSecurity deve ser usado dentro de um ArchbaseViewSecurityProvider");
|
|
2183
2195
|
return r;
|
|
2184
|
-
},
|
|
2185
|
-
const t =
|
|
2186
|
-
return
|
|
2187
|
-
r && e && (
|
|
2188
|
-
}, [r, e,
|
|
2196
|
+
}, ns = (r, e) => {
|
|
2197
|
+
const t = Ze(), { hasPermission: s, hasAnyPermission: n, hasAllPermissions: c, registerAction: l, securityManager: i, isLoading: d, error: g } = t;
|
|
2198
|
+
return ct.useEffect(() => {
|
|
2199
|
+
r && e && (l("create", `Criar ${e}`), l("edit", `Editar ${e}`), l("delete", `Deletar ${e}`), l("view", `Visualizar ${e}`), l("list", `Listar ${e}`));
|
|
2200
|
+
}, [r, e, l]), {
|
|
2189
2201
|
hasPermission: s,
|
|
2190
2202
|
hasAnyPermission: n,
|
|
2191
|
-
hasAllPermissions:
|
|
2192
|
-
registerAction:
|
|
2203
|
+
hasAllPermissions: c,
|
|
2204
|
+
registerAction: l,
|
|
2193
2205
|
securityManager: i,
|
|
2194
2206
|
canCreate: s("create"),
|
|
2195
2207
|
canEdit: s("edit"),
|
|
@@ -2197,52 +2209,52 @@ const Zr = ({
|
|
|
2197
2209
|
canView: s("view"),
|
|
2198
2210
|
canList: s("list"),
|
|
2199
2211
|
isLoading: d,
|
|
2200
|
-
error:
|
|
2212
|
+
error: g
|
|
2201
2213
|
};
|
|
2202
|
-
},
|
|
2203
|
-
const r =
|
|
2214
|
+
}, os = () => {
|
|
2215
|
+
const r = Ze();
|
|
2204
2216
|
return {
|
|
2205
2217
|
check: r.hasPermission,
|
|
2206
2218
|
checkAny: r.hasAnyPermission,
|
|
2207
2219
|
checkAll: r.hasAllPermissions,
|
|
2208
|
-
isAdmin:
|
|
2220
|
+
isAdmin: Ur().isAdmin
|
|
2209
2221
|
};
|
|
2210
|
-
},
|
|
2222
|
+
}, Bt = ({
|
|
2211
2223
|
children: r,
|
|
2212
2224
|
actionName: e,
|
|
2213
2225
|
requiredPermissions: t = [],
|
|
2214
2226
|
requireAll: s = !0,
|
|
2215
2227
|
actionDescription: n,
|
|
2216
|
-
fallback:
|
|
2217
|
-
autoRegister:
|
|
2228
|
+
fallback: c = null,
|
|
2229
|
+
autoRegister: l = !0
|
|
2218
2230
|
}) => {
|
|
2219
|
-
const { hasPermission: i, hasAnyPermission: d, hasAllPermissions:
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
}, [e, n,
|
|
2223
|
-
let
|
|
2224
|
-
return e ?
|
|
2225
|
-
},
|
|
2231
|
+
const { hasPermission: i, hasAnyPermission: d, hasAllPermissions: g, registerAction: k } = Ze();
|
|
2232
|
+
Y(() => {
|
|
2233
|
+
l && e && n && k(e, n);
|
|
2234
|
+
}, [e, n, l, k]);
|
|
2235
|
+
let u = !1;
|
|
2236
|
+
return e ? u = i(e) : t.length > 0 ? u = s ? g(t) : d(t) : u = !0, u ? /* @__PURE__ */ o(ie, { children: r }) : /* @__PURE__ */ o(ie, { children: c });
|
|
2237
|
+
}, is = ({
|
|
2226
2238
|
actionName: r,
|
|
2227
2239
|
actionDescription: e,
|
|
2228
2240
|
children: t,
|
|
2229
2241
|
onClick: s,
|
|
2230
2242
|
disabled: n = !1,
|
|
2231
|
-
className:
|
|
2232
|
-
style:
|
|
2243
|
+
className: c = "",
|
|
2244
|
+
style: l = {},
|
|
2233
2245
|
variant: i = "primary",
|
|
2234
2246
|
size: d = "medium",
|
|
2235
|
-
type:
|
|
2247
|
+
type: g = "button"
|
|
2236
2248
|
}) => {
|
|
2237
2249
|
const k = () => {
|
|
2238
|
-
const
|
|
2239
|
-
return `${
|
|
2240
|
-
},
|
|
2241
|
-
const
|
|
2250
|
+
const T = "archbase-secure-btn", b = `archbase-secure-btn--${i}`, v = `archbase-secure-btn--${d}`;
|
|
2251
|
+
return `${T} ${b} ${v} ${c}`.trim();
|
|
2252
|
+
}, u = () => {
|
|
2253
|
+
const T = {
|
|
2242
2254
|
small: { padding: "4px 8px", fontSize: "12px" },
|
|
2243
2255
|
medium: { padding: "8px 16px", fontSize: "14px" },
|
|
2244
2256
|
large: { padding: "12px 24px", fontSize: "16px" }
|
|
2245
|
-
},
|
|
2257
|
+
}, b = {
|
|
2246
2258
|
primary: { backgroundColor: "#007bff", color: "white" },
|
|
2247
2259
|
secondary: { backgroundColor: "#6c757d", color: "white" },
|
|
2248
2260
|
danger: { backgroundColor: "#dc3545", color: "white" },
|
|
@@ -2255,13 +2267,13 @@ const Zr = ({
|
|
|
2255
2267
|
cursor: n ? "not-allowed" : "pointer",
|
|
2256
2268
|
fontWeight: "500",
|
|
2257
2269
|
opacity: n ? 0.6 : 1,
|
|
2258
|
-
...
|
|
2259
|
-
...
|
|
2260
|
-
...
|
|
2270
|
+
...T[d],
|
|
2271
|
+
...b[i],
|
|
2272
|
+
...l
|
|
2261
2273
|
};
|
|
2262
2274
|
};
|
|
2263
2275
|
return /* @__PURE__ */ o(
|
|
2264
|
-
|
|
2276
|
+
Bt,
|
|
2265
2277
|
{
|
|
2266
2278
|
actionName: r,
|
|
2267
2279
|
actionDescription: e,
|
|
@@ -2269,30 +2281,30 @@ const Zr = ({
|
|
|
2269
2281
|
children: /* @__PURE__ */ o(
|
|
2270
2282
|
"button",
|
|
2271
2283
|
{
|
|
2272
|
-
type:
|
|
2284
|
+
type: g,
|
|
2273
2285
|
onClick: s,
|
|
2274
2286
|
disabled: n,
|
|
2275
2287
|
className: k(),
|
|
2276
|
-
style:
|
|
2288
|
+
style: u(),
|
|
2277
2289
|
children: t
|
|
2278
2290
|
}
|
|
2279
2291
|
)
|
|
2280
2292
|
}
|
|
2281
2293
|
);
|
|
2282
|
-
},
|
|
2294
|
+
}, as = ({
|
|
2283
2295
|
children: r,
|
|
2284
2296
|
actionName: e,
|
|
2285
2297
|
actionDescription: t,
|
|
2286
2298
|
showLabel: s = !0,
|
|
2287
2299
|
label: n,
|
|
2288
|
-
fallbackText:
|
|
2289
|
-
fallbackComponent:
|
|
2300
|
+
fallbackText: c = "Campo não disponível",
|
|
2301
|
+
fallbackComponent: l
|
|
2290
2302
|
}) => e ? /* @__PURE__ */ o(
|
|
2291
|
-
|
|
2303
|
+
Bt,
|
|
2292
2304
|
{
|
|
2293
2305
|
actionName: e,
|
|
2294
2306
|
actionDescription: t,
|
|
2295
|
-
fallback:
|
|
2307
|
+
fallback: l || /* @__PURE__ */ C("div", { className: "archbase-secure-field-fallback", style: {
|
|
2296
2308
|
padding: "8px",
|
|
2297
2309
|
color: "#666",
|
|
2298
2310
|
fontStyle: "italic",
|
|
@@ -2304,20 +2316,20 @@ const Zr = ({
|
|
|
2304
2316
|
n,
|
|
2305
2317
|
": "
|
|
2306
2318
|
] }),
|
|
2307
|
-
|
|
2319
|
+
c
|
|
2308
2320
|
] }),
|
|
2309
2321
|
children: r
|
|
2310
2322
|
}
|
|
2311
2323
|
) : /* @__PURE__ */ o(ie, { children: r });
|
|
2312
|
-
function
|
|
2324
|
+
function cs(r, e) {
|
|
2313
2325
|
return function(s) {
|
|
2314
|
-
const { resourceName: n, resourceDescription:
|
|
2326
|
+
const { resourceName: n, resourceDescription: c, requiredPermissions: l, fallbackComponent: i } = e;
|
|
2315
2327
|
return /* @__PURE__ */ o(
|
|
2316
|
-
|
|
2328
|
+
Tr,
|
|
2317
2329
|
{
|
|
2318
2330
|
resourceName: n,
|
|
2319
|
-
resourceDescription:
|
|
2320
|
-
requiredPermissions:
|
|
2331
|
+
resourceDescription: c,
|
|
2332
|
+
requiredPermissions: l,
|
|
2321
2333
|
fallbackComponent: i,
|
|
2322
2334
|
children: /* @__PURE__ */ o(r, { ...s })
|
|
2323
2335
|
}
|
|
@@ -2325,77 +2337,77 @@ function as(r, e) {
|
|
|
2325
2337
|
};
|
|
2326
2338
|
}
|
|
2327
2339
|
export {
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2340
|
+
Nt as ARCHBASE_SECURITY_MANAGER_STORE,
|
|
2341
|
+
Sr as AccessIntervalDto,
|
|
2342
|
+
Et as AccessScheduleDto,
|
|
2343
|
+
Xe as AccessTokenDto,
|
|
2344
|
+
kr as ActionDto,
|
|
2345
|
+
Ye as ApiTokenDto,
|
|
2346
|
+
_t as ArchbaseAccessTokenService,
|
|
2347
|
+
Dt as ArchbaseApiTokenService,
|
|
2348
|
+
Ar as ArchbaseAuthContext,
|
|
2349
|
+
Jr as ArchbaseAuthProvider,
|
|
2350
|
+
Tt as ArchbaseGroupService,
|
|
2351
|
+
Yr as ArchbaseLogin,
|
|
2352
|
+
Xr as ArchbaseMfaSetup,
|
|
2353
|
+
Ut as ArchbaseProfileService,
|
|
2354
|
+
Bt as ArchbaseProtectedComponent,
|
|
2355
|
+
Qr as ArchbaseResetPassword,
|
|
2356
|
+
Rt as ArchbaseResourceService,
|
|
2357
|
+
is as ArchbaseSecureActionButton,
|
|
2358
|
+
as as ArchbaseSecureFormField,
|
|
2359
|
+
Mt as ArchbaseSecurityDiagnosticsService,
|
|
2360
|
+
wt as ArchbaseSecurityManager,
|
|
2361
|
+
ss as ArchbaseSecurityProvider,
|
|
2362
|
+
G as ArchbaseTenantManager,
|
|
2363
|
+
pt as ArchbaseUser,
|
|
2364
|
+
Pt as ArchbaseUserService,
|
|
2365
|
+
ft as ArchbaseUsernameAndPassword,
|
|
2366
|
+
ft as ArchbaseUsernameAndPasswordImpl,
|
|
2367
|
+
Tr as ArchbaseViewSecurityProvider,
|
|
2368
|
+
Oe as CONTEXT_STORAGE_KEY,
|
|
2369
|
+
ir as DefaultArchbaseTokenManager,
|
|
2370
|
+
Pr as DefaultSecurityLoading,
|
|
2359
2371
|
le as ENCRYPTION_KEY,
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2372
|
+
gt as FetchError,
|
|
2373
|
+
Ie as GroupDto,
|
|
2374
|
+
qr as PermissionDto,
|
|
2375
|
+
ke as ProfileDto,
|
|
2376
|
+
It as ResourceDto,
|
|
2377
|
+
ve as SecurityDto,
|
|
2378
|
+
ge as SecurityType,
|
|
2379
|
+
$e as TOKEN_COOKIE_NAME,
|
|
2380
|
+
xr as TipoRecurso,
|
|
2381
|
+
Le as USER_NAME,
|
|
2382
|
+
Be as USER_NAME_AND_PASSWORD,
|
|
2383
|
+
Ne as UserDto,
|
|
2384
|
+
Ke as UserGroupDto,
|
|
2385
|
+
yr as createInternalConfig,
|
|
2386
|
+
Ue as decodeJWT,
|
|
2387
|
+
fe as epochAtSecondsFromNow,
|
|
2388
|
+
at as epochTimeIsPast,
|
|
2389
|
+
pr as fetchTokens,
|
|
2390
|
+
fr as fetchWithRefreshToken,
|
|
2391
|
+
cr as generateCodeChallenge,
|
|
2392
|
+
ar as generateRandomString,
|
|
2393
|
+
mt as getRandomInteger,
|
|
2394
|
+
br as getRefreshExpiresIn,
|
|
2395
|
+
ze as isCredentialsExpiredError,
|
|
2396
|
+
dr as postWithXForm,
|
|
2397
|
+
ur as redirectToLogin,
|
|
2398
|
+
mr as redirectToLogout,
|
|
2399
|
+
es as useArchbaseAuthenticationManager,
|
|
2400
|
+
ts as useArchbaseGetCurrentToken,
|
|
2401
|
+
Cr as useArchbaseGetLoggedUser,
|
|
2402
|
+
os as useArchbasePermissionCheck,
|
|
2403
|
+
rs as useArchbaseResetPassword,
|
|
2404
|
+
ns as useArchbaseSecureForm,
|
|
2405
|
+
Ur as useArchbaseSecurity,
|
|
2406
|
+
Zr as useArchbaseSecurityManager,
|
|
2407
|
+
Kr as useArchbaseTenantManager,
|
|
2408
|
+
Ze as useArchbaseViewSecurity,
|
|
2409
|
+
Gr as useBrowserStorage,
|
|
2410
|
+
vr as validateConfig,
|
|
2411
|
+
gr as validateState,
|
|
2412
|
+
cs as withArchbaseSecurity
|
|
2401
2413
|
};
|