@archbase/security 4.0.39 → 4.0.40
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
|
-
import * as
|
|
3
|
-
import { decorate as
|
|
4
|
-
import { compressString as
|
|
5
|
-
import
|
|
2
|
+
import * as U from "inversify";
|
|
3
|
+
import { decorate as Mt, injectable as Nt } from "inversify";
|
|
4
|
+
import { compressString as Bt, decompressString as Ot, IOCContainer as Lt, ARCHBASE_IOC_API_TYPE as X, processErrorMessage as oe, IsNotEmpty as Q, IsOptional as de, IsBoolean as re, IsEmail as $t, getKeyByEnumValue as Ye, useArchbasePasswordRemember as zt, getI18nextInstance as x, useArchbaseTheme as jt, isEmailValidate as Ft, useArchbaseAppContext as Vt } from "@archbase/core";
|
|
5
|
+
import G from "crypto-js";
|
|
6
6
|
import { jwtDecode as Wt } from "jwt-decode";
|
|
7
|
-
import { jsx as n, jsxs as
|
|
8
|
-
import
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import { ArchbaseRemoteApiService as
|
|
11
|
-
import { v4 as
|
|
12
|
-
import { Card as
|
|
13
|
-
import { useFocusTrap as
|
|
7
|
+
import { jsx as n, jsxs as P, Fragment as ne } from "react/jsx-runtime";
|
|
8
|
+
import ot, { useState as h, useEffect as K, createContext as je, useMemo as nt, useRef as it, useCallback as Se, useContext as Fe } from "react";
|
|
9
|
+
import { BehaviorSubject as Xe } from "rxjs";
|
|
10
|
+
import { ArchbaseRemoteApiService as me, useArchbaseStore as at } from "@archbase/data";
|
|
11
|
+
import { v4 as Z } from "uuid";
|
|
12
|
+
import { Card as Ve, Text as j, Divider as Te, Stack as be, TextInput as Ae, Button as W, Anchor as Qe, Group as le, Select as Ht, Tooltip as Gt, Loader as ct, PasswordInput as Le, Checkbox as Jt, Alert as Ze, Code as et, CopyButton as tt, SimpleGrid as Kt, useMantineColorScheme as qt, Box as Yt, Skeleton as Ie } from "@mantine/core";
|
|
13
|
+
import { useFocusTrap as lt } from "@mantine/hooks";
|
|
14
14
|
import { IconCopy as Xt } from "@tabler/icons-react";
|
|
15
|
-
import { ArchbaseQRCode as Qt, ArchbaseDialog as
|
|
16
|
-
import { useContainer as
|
|
17
|
-
class
|
|
15
|
+
import { ArchbaseQRCode as Qt, ArchbaseDialog as rt } from "@archbase/components";
|
|
16
|
+
import { useContainer as Ue } from "inversify-react";
|
|
17
|
+
class dt {
|
|
18
18
|
id;
|
|
19
19
|
displayName;
|
|
20
20
|
email;
|
|
@@ -24,10 +24,10 @@ class lt {
|
|
|
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 dt({});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class ut {
|
|
31
31
|
username;
|
|
32
32
|
password;
|
|
33
33
|
remember;
|
|
@@ -35,16 +35,16 @@ class dt {
|
|
|
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 ut({});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const ae = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=", Me = "c1ab58e7-c113-4225-a190-a9e59d1207fc", Ne = "6faf6932-a0b5-457b-83b1-8d89ddbd91fd", Be = "602b05c5-ec46-451e-aba6-187e463bc245", Oe = "8b4a7c2d-9e5f-4163-b8a7-3f2c9d8e5a1b";
|
|
42
42
|
class Zt {
|
|
43
43
|
getUsernameAndPassword() {
|
|
44
44
|
try {
|
|
45
45
|
const e = localStorage.getItem(Ne);
|
|
46
46
|
if (e) {
|
|
47
|
-
const t =
|
|
47
|
+
const t = G.AES.decrypt(e, ae).toString(G.enc.Utf8), o = atob(t).split(":");
|
|
48
48
|
return { username: o[0], password: o[1], remember: !0 };
|
|
49
49
|
} else
|
|
50
50
|
return null;
|
|
@@ -53,14 +53,14 @@ class Zt {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
saveUsernameAndPassword(e, t) {
|
|
56
|
-
const s = btoa(`${e}:${t}`), o =
|
|
56
|
+
const s = btoa(`${e}:${t}`), o = G.AES.encrypt(s, ae).toString();
|
|
57
57
|
localStorage.setItem(Ne, o);
|
|
58
58
|
}
|
|
59
59
|
getUsername() {
|
|
60
60
|
try {
|
|
61
61
|
const e = localStorage.getItem(Be);
|
|
62
62
|
if (e) {
|
|
63
|
-
const t =
|
|
63
|
+
const t = G.AES.decrypt(e, ae).toString(G.enc.Utf8);
|
|
64
64
|
return atob(t);
|
|
65
65
|
} else
|
|
66
66
|
return null;
|
|
@@ -69,7 +69,7 @@ class Zt {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
saveUsername(e) {
|
|
72
|
-
const t = btoa(e), s =
|
|
72
|
+
const t = btoa(e), s = G.AES.encrypt(t, ae).toString();
|
|
73
73
|
localStorage.setItem(Be, s);
|
|
74
74
|
}
|
|
75
75
|
isTokenExpired(e, t = 300) {
|
|
@@ -80,16 +80,16 @@ class Zt {
|
|
|
80
80
|
const o = Wt(s.access_token);
|
|
81
81
|
if (!o)
|
|
82
82
|
return !0;
|
|
83
|
-
const
|
|
84
|
-
return
|
|
83
|
+
const a = Math.floor(Date.now() / 1e3), c = o.exp;
|
|
84
|
+
return a > c - 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 = G.AES.encrypt(t, ae).toString(), o = Bt(s);
|
|
92
|
+
localStorage.setItem(Me, o);
|
|
93
93
|
} else
|
|
94
94
|
this.clearToken();
|
|
95
95
|
}
|
|
@@ -97,14 +97,14 @@ class Zt {
|
|
|
97
97
|
localStorage.removeItem(Ne), localStorage.removeItem(Be);
|
|
98
98
|
}
|
|
99
99
|
clearToken() {
|
|
100
|
-
localStorage.removeItem(
|
|
100
|
+
localStorage.removeItem(Me);
|
|
101
101
|
}
|
|
102
102
|
getToken() {
|
|
103
103
|
try {
|
|
104
|
-
const e = localStorage.getItem(
|
|
104
|
+
const e = localStorage.getItem(Me);
|
|
105
105
|
if (!e)
|
|
106
106
|
return null;
|
|
107
|
-
const t = Ot(e), s =
|
|
107
|
+
const t = Ot(e), s = G.AES.decrypt(t, ae).toString(G.enc.Utf8);
|
|
108
108
|
return JSON.parse(s);
|
|
109
109
|
} catch {
|
|
110
110
|
return null;
|
|
@@ -112,34 +112,34 @@ class Zt {
|
|
|
112
112
|
}
|
|
113
113
|
saveContext(e) {
|
|
114
114
|
try {
|
|
115
|
-
const t =
|
|
116
|
-
localStorage.setItem(
|
|
115
|
+
const t = G.AES.encrypt(e, ae).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 ? G.AES.decrypt(e, ae).toString(G.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
|
-
Nt(
|
|
134
|
-
function
|
|
133
|
+
Mt(Nt(), Zt);
|
|
134
|
+
function ht(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 ? ht(r) : t[0] % r;
|
|
137
137
|
}
|
|
138
138
|
function er(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(ht(t.length - 1));
|
|
143
143
|
return e;
|
|
144
144
|
}
|
|
145
145
|
async function tr(r) {
|
|
@@ -150,7 +150,7 @@ async function tr(r) {
|
|
|
150
150
|
const t = new TextEncoder().encode(r), s = await window.crypto.subtle.digest("SHA-256", t), o = String.fromCharCode(...new Uint8Array(s));
|
|
151
151
|
return btoa(o).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class pt extends Error {
|
|
154
154
|
status;
|
|
155
155
|
statusText;
|
|
156
156
|
constructor(e, t, s) {
|
|
@@ -171,15 +171,15 @@ async function sr(r, e) {
|
|
|
171
171
|
}).then(async (t) => {
|
|
172
172
|
if (!t.ok) {
|
|
173
173
|
const s = await t.text();
|
|
174
|
-
throw new
|
|
174
|
+
throw new pt(t.status, t.statusText, s);
|
|
175
175
|
}
|
|
176
176
|
return t;
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const
|
|
179
|
+
const ft = "PKCE_code_verifier", $e = "ROCP_auth_state";
|
|
180
180
|
async function or(r, e) {
|
|
181
181
|
const t = er(96);
|
|
182
|
-
return sessionStorage.setItem(
|
|
182
|
+
return sessionStorage.setItem(ft, t), tr(t).then((s) => {
|
|
183
183
|
const o = new URLSearchParams({
|
|
184
184
|
response_type: "code",
|
|
185
185
|
client_id: r.clientId,
|
|
@@ -188,9 +188,9 @@ async function or(r, e) {
|
|
|
188
188
|
code_challenge_method: "S256",
|
|
189
189
|
...r.extraAuthParameters
|
|
190
190
|
});
|
|
191
|
-
r.scope !== void 0 && o.append("scope", r.scope), sessionStorage.removeItem(
|
|
192
|
-
const
|
|
193
|
-
|
|
191
|
+
r.scope !== void 0 && o.append("scope", r.scope), sessionStorage.removeItem($e);
|
|
192
|
+
const a = e ?? r.state;
|
|
193
|
+
a && (sessionStorage.setItem($e, a), o.append("state", a)), r?.preLogin && r.preLogin(), window.location.replace(`${r.authorizationEndpoint}?${o.toString()}`);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
function nr(r) {
|
|
@@ -204,7 +204,7 @@ function mt(r, e) {
|
|
|
204
204
|
}));
|
|
205
205
|
}
|
|
206
206
|
const ir = (r) => {
|
|
207
|
-
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(
|
|
207
|
+
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(ft);
|
|
208
208
|
if (!t)
|
|
209
209
|
throw Error(`Parâmetro 'código' não encontrado na URL.
|
|
210
210
|
A autenticação ocorreu?`);
|
|
@@ -233,60 +233,60 @@ A autenticação ocorreu?`);
|
|
|
233
233
|
};
|
|
234
234
|
return mt(e.tokenEndpoint, s);
|
|
235
235
|
};
|
|
236
|
-
function cr(r, e, t, s, o,
|
|
237
|
-
const
|
|
236
|
+
function cr(r, e, t, s, o, a) {
|
|
237
|
+
const c = new URLSearchParams({
|
|
238
238
|
token: t || e,
|
|
239
239
|
token_type_hint: t ? "refresh_token" : "access_token",
|
|
240
240
|
client_id: r.clientId,
|
|
241
241
|
post_logout_redirect_uri: r.logoutRedirect ?? r.redirectUri,
|
|
242
|
-
ui_locales: window.navigator.languages.reduce((
|
|
242
|
+
ui_locales: window.navigator.languages.reduce((i, l) => i + " " + l),
|
|
243
243
|
...r.extraLogoutParameters
|
|
244
244
|
});
|
|
245
|
-
s &&
|
|
245
|
+
s && c.append("id_token_hint", s), o && c.append("state", o), a && c.append("logout_hint", a), window.location.replace(`${r.logoutEndpoint}?${c.toString()}`);
|
|
246
246
|
}
|
|
247
247
|
function lr(r) {
|
|
248
|
-
const e = r.get("state"), t = sessionStorage.getItem(
|
|
248
|
+
const e = r.get("state"), t = sessionStorage.getItem($e);
|
|
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
|
-
function
|
|
255
|
-
const s = t === "session" ? sessionStorage : localStorage, [o,
|
|
256
|
-
const
|
|
254
|
+
function ce(r, e, t) {
|
|
255
|
+
const s = t === "session" ? sessionStorage : localStorage, [o, a] = h(() => {
|
|
256
|
+
const i = s.getItem(r);
|
|
257
257
|
try {
|
|
258
|
-
return
|
|
259
|
-
} catch (
|
|
258
|
+
return i ? JSON.parse(i) : e;
|
|
259
|
+
} catch (l) {
|
|
260
260
|
return console.warn(
|
|
261
261
|
`Falha ao analisar o valor armazenado para '${r}'.
|
|
262
262
|
Continuando com o valor padrão.
|
|
263
|
-
Error: ${
|
|
263
|
+
Error: ${l.message}`
|
|
264
264
|
), e;
|
|
265
265
|
}
|
|
266
|
-
}),
|
|
267
|
-
if (
|
|
268
|
-
|
|
266
|
+
}), c = (i) => {
|
|
267
|
+
if (i === void 0) {
|
|
268
|
+
a(i), s.removeItem(r);
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
try {
|
|
272
|
-
const
|
|
273
|
-
|
|
272
|
+
const l = i instanceof Function ? i(o) : i;
|
|
273
|
+
a(l), s.setItem(r, JSON.stringify(l));
|
|
274
274
|
} catch {
|
|
275
|
-
console.log(`Falha ao armazenar valor '${
|
|
275
|
+
console.log(`Falha ao armazenar valor '${i}' para chave '${r}'`);
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
|
-
return
|
|
279
|
-
const
|
|
280
|
-
|
|
278
|
+
return K(() => {
|
|
279
|
+
const i = (l) => {
|
|
280
|
+
l.storageArea === s && l.key === r && a(JSON.parse(l.newValue ?? ""));
|
|
281
281
|
};
|
|
282
|
-
return window.addEventListener("storage",
|
|
283
|
-
}), [o,
|
|
282
|
+
return window.addEventListener("storage", i, !1), () => window.removeEventListener("storage", i, !1);
|
|
283
|
+
}), [o, c];
|
|
284
284
|
}
|
|
285
285
|
const $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
286
286
|
__proto__: null,
|
|
287
|
-
default:
|
|
287
|
+
default: ce
|
|
288
288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
289
|
-
function
|
|
289
|
+
function Ce(r) {
|
|
290
290
|
return ["", void 0, null].includes(r);
|
|
291
291
|
}
|
|
292
292
|
function dr(r) {
|
|
@@ -295,37 +295,37 @@ function dr(r) {
|
|
|
295
295
|
clearURL: t = !0,
|
|
296
296
|
decodeToken: s = !0,
|
|
297
297
|
scope: o = void 0,
|
|
298
|
-
preLogin:
|
|
299
|
-
postLogin:
|
|
300
|
-
onRefreshTokenExpire:
|
|
301
|
-
storage:
|
|
302
|
-
} = r,
|
|
298
|
+
preLogin: a = () => null,
|
|
299
|
+
postLogin: c = () => null,
|
|
300
|
+
onRefreshTokenExpire: i = void 0,
|
|
301
|
+
storage: l = "local"
|
|
302
|
+
} = r, g = {
|
|
303
303
|
...r,
|
|
304
304
|
autoLogin: e,
|
|
305
305
|
clearURL: t,
|
|
306
306
|
decodeToken: s,
|
|
307
307
|
scope: o,
|
|
308
|
-
preLogin:
|
|
309
|
-
postLogin:
|
|
310
|
-
onRefreshTokenExpire:
|
|
311
|
-
storage:
|
|
308
|
+
preLogin: a,
|
|
309
|
+
postLogin: c,
|
|
310
|
+
onRefreshTokenExpire: i,
|
|
311
|
+
storage: l
|
|
312
312
|
};
|
|
313
|
-
return ur(
|
|
313
|
+
return ur(g), g;
|
|
314
314
|
}
|
|
315
315
|
function ur(r) {
|
|
316
|
-
if (
|
|
316
|
+
if (Ce(r?.clientId))
|
|
317
317
|
throw Error(
|
|
318
318
|
"'clientId' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
319
319
|
);
|
|
320
|
-
if (
|
|
320
|
+
if (Ce(r?.authorizationEndpoint))
|
|
321
321
|
throw Error(
|
|
322
322
|
"'authorizationEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
323
323
|
);
|
|
324
|
-
if (
|
|
324
|
+
if (Ce(r?.tokenEndpoint))
|
|
325
325
|
throw Error(
|
|
326
326
|
"'tokenEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
327
327
|
);
|
|
328
|
-
if (
|
|
328
|
+
if (Ce(r?.redirectUri))
|
|
329
329
|
throw Error(
|
|
330
330
|
"'redirectUri' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
331
331
|
);
|
|
@@ -337,8 +337,8 @@ function ur(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 pe = 600, he = (r) => Math.round(Date.now() / 1e3 + r);
|
|
341
|
+
function st(r) {
|
|
342
342
|
return Math.round(Date.now()) / 1e3 + 30 >= r;
|
|
343
343
|
}
|
|
344
344
|
const hr = [
|
|
@@ -351,9 +351,9 @@ function pr(r, e) {
|
|
|
351
351
|
for (const t of hr)
|
|
352
352
|
if (t in e)
|
|
353
353
|
return e[t];
|
|
354
|
-
return e.refresh_token ? r +
|
|
354
|
+
return e.refresh_token ? r + pe : r;
|
|
355
355
|
}
|
|
356
|
-
const
|
|
356
|
+
const Pe = (r) => {
|
|
357
357
|
try {
|
|
358
358
|
const t = r.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), s = decodeURIComponent(
|
|
359
359
|
atob(t).split("").map(function(o) {
|
|
@@ -368,88 +368,88 @@ const Ce = (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
|
+
}, fr = je({
|
|
372
372
|
token: "",
|
|
373
373
|
login: () => null,
|
|
374
374
|
logOut: () => null,
|
|
375
375
|
error: null,
|
|
376
376
|
loginInProgress: !1
|
|
377
377
|
}), zr = ({ authConfig: r, children: e }) => {
|
|
378
|
-
const t =
|
|
378
|
+
const t = nt(() => dr(r), [r]), [s, o] = ce(
|
|
379
379
|
"ROCP_refreshToken",
|
|
380
380
|
void 0,
|
|
381
381
|
t.storage
|
|
382
|
-
), [
|
|
382
|
+
), [a, c] = ce(
|
|
383
383
|
"ROCP_refreshTokenExpire",
|
|
384
|
-
|
|
384
|
+
he(2 * pe),
|
|
385
385
|
t.storage
|
|
386
|
-
), [
|
|
386
|
+
), [i, l] = ce("ROCP_token", "", t.storage), [g, E] = ce(
|
|
387
387
|
"ROCP_tokenExpire",
|
|
388
|
-
|
|
388
|
+
he(pe),
|
|
389
389
|
t.storage
|
|
390
|
-
), [
|
|
390
|
+
), [d, _] = ce(
|
|
391
391
|
"ROCP_idToken",
|
|
392
392
|
void 0,
|
|
393
393
|
t.storage
|
|
394
|
-
), [v,
|
|
394
|
+
), [v, f] = ce(
|
|
395
395
|
"ROCP_loginInProgress",
|
|
396
396
|
!1,
|
|
397
397
|
t.storage
|
|
398
|
-
), [S,
|
|
398
|
+
), [S, D] = ce(
|
|
399
399
|
"ROCP_refreshInProgress",
|
|
400
400
|
!1,
|
|
401
401
|
t.storage
|
|
402
|
-
), [B,
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
o(void 0),
|
|
406
|
-
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
let
|
|
413
|
-
|
|
414
|
-
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${
|
|
415
|
-
),
|
|
416
|
-
console.error(
|
|
402
|
+
), [B, O] = h(), [F, N] = h(), [w, m] = h(null);
|
|
403
|
+
let R;
|
|
404
|
+
function V() {
|
|
405
|
+
o(void 0), l(""), E(he(pe)), c(he(pe)), _(void 0), O(void 0), N(void 0), f(!1);
|
|
406
|
+
}
|
|
407
|
+
function C(p, y) {
|
|
408
|
+
V(), m(null), t?.logoutEndpoint && cr(t, i, s, d, p, y);
|
|
409
|
+
}
|
|
410
|
+
function L(p) {
|
|
411
|
+
V(), f(!0);
|
|
412
|
+
let y = p;
|
|
413
|
+
p && typeof p != "string" && (console.warn(
|
|
414
|
+
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${p}'. Ignorando o valor...`
|
|
415
|
+
), y = void 0), or(t, y).catch((te) => {
|
|
416
|
+
console.error(te), m(te.message), f(!1);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
|
|
419
|
+
function q(p) {
|
|
420
|
+
l(p.access_token), o(p.refresh_token);
|
|
421
|
+
const y = t.tokenExpiresIn ?? p.expires_in ?? pe;
|
|
422
|
+
E(he(y));
|
|
423
|
+
const te = t.refreshTokenExpiresIn ?? pr(y, p);
|
|
424
|
+
c(he(te)), _(p.id_token);
|
|
425
425
|
try {
|
|
426
|
-
|
|
427
|
-
} catch (
|
|
428
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
426
|
+
p.id_token && N(Pe(p.id_token));
|
|
427
|
+
} catch (T) {
|
|
428
|
+
console.warn(`Falha ao decodificar idToken: ${T.message}`);
|
|
429
429
|
}
|
|
430
430
|
try {
|
|
431
|
-
t.decodeToken &&
|
|
432
|
-
} catch (
|
|
433
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
431
|
+
t.decodeToken && O(Pe(p.access_token));
|
|
432
|
+
} catch (T) {
|
|
433
|
+
console.warn(`Falha ao decodificar o token de acesso: ${T.message}`);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function ee(p = !1) {
|
|
437
|
+
return p || !t.onRefreshTokenExpire ? L() : t.onRefreshTokenExpire({ login: L });
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
if (
|
|
441
|
-
if (
|
|
442
|
-
return
|
|
439
|
+
function Y(p = !1) {
|
|
440
|
+
if (i && st(g) && !(S && !p)) {
|
|
441
|
+
if (st(a))
|
|
442
|
+
return ee(p);
|
|
443
443
|
if (s) {
|
|
444
|
-
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
447
|
-
return
|
|
448
|
-
console.error(
|
|
444
|
+
D(!0), ar({ config: t, refreshToken: s }).then((y) => q(y)).catch((y) => {
|
|
445
|
+
if (y instanceof pt) {
|
|
446
|
+
if (y.status === 400)
|
|
447
|
+
return ee(p);
|
|
448
|
+
console.error(y), m(y.message), p && L();
|
|
449
449
|
} else
|
|
450
|
-
|
|
450
|
+
y instanceof Error && (console.error(y), m(y.message), p && L());
|
|
451
451
|
}).finally(() => {
|
|
452
|
-
|
|
452
|
+
D(!1);
|
|
453
453
|
});
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
@@ -458,55 +458,55 @@ const Ce = (r) => {
|
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
return
|
|
461
|
+
K(() => (R = setInterval(() => Y(), 1e4), () => clearInterval(R)), [i, s, a, g]);
|
|
462
|
+
const ie = it(!1);
|
|
463
|
+
return K(() => {
|
|
464
464
|
if (v) {
|
|
465
|
-
const
|
|
466
|
-
if (!
|
|
467
|
-
const
|
|
468
|
-
console.error(
|
|
465
|
+
const p = new URLSearchParams(window.location.search);
|
|
466
|
+
if (!p.get("code")) {
|
|
467
|
+
const y = p.get("error_description") || "Estado de autorização inválido. Atualizar a página pode resolver o problema.";
|
|
468
|
+
console.error(y), m(y), C();
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
if (!
|
|
472
|
-
|
|
471
|
+
if (!ie.current) {
|
|
472
|
+
ie.current = !0;
|
|
473
473
|
try {
|
|
474
|
-
lr(
|
|
475
|
-
} catch (
|
|
476
|
-
console.error(
|
|
474
|
+
lr(p);
|
|
475
|
+
} catch (y) {
|
|
476
|
+
console.error(y), m(y.message);
|
|
477
477
|
}
|
|
478
|
-
ir(t).then((
|
|
479
|
-
|
|
480
|
-
}).catch((
|
|
481
|
-
console.error(
|
|
478
|
+
ir(t).then((y) => {
|
|
479
|
+
q(y), t?.postLogin && t.postLogin();
|
|
480
|
+
}).catch((y) => {
|
|
481
|
+
console.error(y), m(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), f(!1);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
return;
|
|
487
487
|
}
|
|
488
|
-
if (!
|
|
489
|
-
return
|
|
488
|
+
if (!i && t.autoLogin)
|
|
489
|
+
return L();
|
|
490
490
|
try {
|
|
491
|
-
|
|
492
|
-
} catch (
|
|
493
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
491
|
+
d && N(Pe(d));
|
|
492
|
+
} catch (p) {
|
|
493
|
+
console.warn(`Falha ao decodificar idToken: ${p.message}`);
|
|
494
494
|
}
|
|
495
495
|
try {
|
|
496
|
-
t.decodeToken &&
|
|
497
|
-
} catch (
|
|
498
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
496
|
+
t.decodeToken && O(Pe(i));
|
|
497
|
+
} catch (p) {
|
|
498
|
+
console.warn(`Falha ao decodificar o token de acesso: ${p.message}`);
|
|
499
499
|
}
|
|
500
|
-
|
|
500
|
+
Y(!0);
|
|
501
501
|
}, []), /* @__PURE__ */ n(
|
|
502
|
-
|
|
502
|
+
fr.Provider,
|
|
503
503
|
{
|
|
504
|
-
value: { token:
|
|
504
|
+
value: { token: i, tokenData: B, idToken: d, idTokenData: F, login: L, logOut: C, error: w, loginInProgress: v },
|
|
505
505
|
children: e
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
508
|
};
|
|
509
|
-
class
|
|
509
|
+
class gt {
|
|
510
510
|
resourceService;
|
|
511
511
|
resource;
|
|
512
512
|
actions;
|
|
@@ -515,7 +515,7 @@ class ft {
|
|
|
515
515
|
error;
|
|
516
516
|
isAdmin;
|
|
517
517
|
constructor(e, t, s) {
|
|
518
|
-
this.resourceService = Lt.getContainer().get(
|
|
518
|
+
this.resourceService = Lt.getContainer().get(X.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 });
|
|
@@ -524,7 +524,7 @@ class ft {
|
|
|
524
524
|
this.alreadyApplied || (this.alreadyApplied = !0, this.resourceService.registerResource({ resource: this.resource, actions: this.actions }).then((t) => {
|
|
525
525
|
this.permissions = t.permissions, this.error = "", e && e();
|
|
526
526
|
}).catch((t) => {
|
|
527
|
-
this.alreadyApplied = !1, this.error =
|
|
527
|
+
this.alreadyApplied = !1, this.error = oe(t);
|
|
528
528
|
}));
|
|
529
529
|
}
|
|
530
530
|
hasPermission(e) {
|
|
@@ -586,10 +586,10 @@ class ft {
|
|
|
586
586
|
return [...this.actions];
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
class
|
|
589
|
+
class J {
|
|
590
590
|
static instance;
|
|
591
|
-
_currentTenant = new
|
|
592
|
-
_availableTenants = new
|
|
591
|
+
_currentTenant = new Xe(null);
|
|
592
|
+
_availableTenants = new Xe([]);
|
|
593
593
|
constructor() {
|
|
594
594
|
const e = localStorage.getItem("tenant_info");
|
|
595
595
|
if (e)
|
|
@@ -600,7 +600,7 @@ class G {
|
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
static getInstance() {
|
|
603
|
-
return
|
|
603
|
+
return J.instance || (J.instance = new J()), J.instance;
|
|
604
604
|
}
|
|
605
605
|
get currentTenant$() {
|
|
606
606
|
return this._currentTenant.asObservable();
|
|
@@ -630,14 +630,14 @@ class G {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
function jr() {
|
|
633
|
-
return
|
|
633
|
+
return J.getInstance();
|
|
634
634
|
}
|
|
635
|
-
var
|
|
636
|
-
for (var o = void 0,
|
|
637
|
-
(
|
|
638
|
-
return o &&
|
|
635
|
+
var fe = /* @__PURE__ */ ((r) => (r.USER = "user", r.PROFILE = "profile", r.GROUP = "group", r))(fe || {}), mr = Object.defineProperty, k = (r, e, t, s) => {
|
|
636
|
+
for (var o = void 0, a = r.length - 1, c; a >= 0; a--)
|
|
637
|
+
(c = r[a]) && (o = c(e, t, o) || o);
|
|
638
|
+
return o && mr(e, t, o), o;
|
|
639
639
|
}, gr = /* @__PURE__ */ ((r) => (r.VIEW = "VIEW", r.API = "API", r))(gr || {});
|
|
640
|
-
const
|
|
640
|
+
const yt = class wt {
|
|
641
641
|
id;
|
|
642
642
|
code;
|
|
643
643
|
version;
|
|
@@ -650,18 +650,18 @@ const gt = class yt {
|
|
|
650
650
|
constructor(e) {
|
|
651
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 yr(t)) : [];
|
|
652
652
|
}
|
|
653
|
-
static newInstance = () => new
|
|
654
|
-
id:
|
|
653
|
+
static newInstance = () => new wt({
|
|
654
|
+
id: Z(),
|
|
655
655
|
intervals: []
|
|
656
656
|
});
|
|
657
657
|
};
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
k([
|
|
659
|
+
Q({
|
|
660
660
|
message: "archbase:Informe a descrição do cronograma de acesso"
|
|
661
661
|
})
|
|
662
|
-
],
|
|
663
|
-
let
|
|
664
|
-
const
|
|
662
|
+
], yt.prototype, "description");
|
|
663
|
+
let vt = yt;
|
|
664
|
+
const De = class bt {
|
|
665
665
|
id;
|
|
666
666
|
code;
|
|
667
667
|
version;
|
|
@@ -674,30 +674,30 @@ const Ue = class vt {
|
|
|
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 vt(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 bt({
|
|
680
|
+
id: Z(),
|
|
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
|
-
|
|
690
|
-
|
|
686
|
+
k([
|
|
687
|
+
de()
|
|
688
|
+
], De.prototype, "accessSchedule");
|
|
689
|
+
k([
|
|
690
|
+
Q({
|
|
691
691
|
message: "archbase:Informe a hora de início"
|
|
692
692
|
})
|
|
693
|
-
],
|
|
694
|
-
|
|
695
|
-
|
|
693
|
+
], De.prototype, "startTime");
|
|
694
|
+
k([
|
|
695
|
+
Q({
|
|
696
696
|
message: "archbase:Informe a hora de término"
|
|
697
697
|
})
|
|
698
|
-
],
|
|
699
|
-
let yr =
|
|
700
|
-
class
|
|
698
|
+
], De.prototype, "endTime");
|
|
699
|
+
let yr = De;
|
|
700
|
+
class ge {
|
|
701
701
|
id;
|
|
702
702
|
code;
|
|
703
703
|
version;
|
|
@@ -712,20 +712,20 @@ class me {
|
|
|
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
|
-
|
|
716
|
-
|
|
715
|
+
k([
|
|
716
|
+
Q({
|
|
717
717
|
message: "archbase:Informe o nome"
|
|
718
718
|
})
|
|
719
|
-
],
|
|
720
|
-
|
|
721
|
-
|
|
719
|
+
], ge.prototype, "name");
|
|
720
|
+
k([
|
|
721
|
+
Q({
|
|
722
722
|
message: "archbase:Informe a descrição"
|
|
723
723
|
})
|
|
724
|
-
],
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
],
|
|
728
|
-
const
|
|
724
|
+
], ge.prototype, "description");
|
|
725
|
+
k([
|
|
726
|
+
de()
|
|
727
|
+
], ge.prototype, "actions");
|
|
728
|
+
const ye = class At {
|
|
729
729
|
id;
|
|
730
730
|
code;
|
|
731
731
|
version;
|
|
@@ -741,48 +741,48 @@ const fe = class bt {
|
|
|
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 xt(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 At({
|
|
747
|
+
id: Z(),
|
|
748
748
|
active: !0,
|
|
749
749
|
isNewAction: !0
|
|
750
750
|
});
|
|
751
751
|
};
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
k([
|
|
753
|
+
Q({
|
|
754
754
|
message: "archbase:Informe o nome para a ação"
|
|
755
755
|
})
|
|
756
|
-
],
|
|
757
|
-
|
|
758
|
-
|
|
756
|
+
], ye.prototype, "name");
|
|
757
|
+
k([
|
|
758
|
+
Q({
|
|
759
759
|
message: "archbase:Informe a descrição para a ação"
|
|
760
760
|
})
|
|
761
|
-
],
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
],
|
|
765
|
-
|
|
766
|
-
|
|
761
|
+
], ye.prototype, "description");
|
|
762
|
+
k([
|
|
763
|
+
de()
|
|
764
|
+
], ye.prototype, "resource");
|
|
765
|
+
k([
|
|
766
|
+
Q({
|
|
767
767
|
message: "archbase:Informe a categoria para a ação"
|
|
768
768
|
})
|
|
769
|
-
],
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
],
|
|
773
|
-
let wr =
|
|
774
|
-
class
|
|
769
|
+
], ye.prototype, "category");
|
|
770
|
+
k([
|
|
771
|
+
re()
|
|
772
|
+
], ye.prototype, "active");
|
|
773
|
+
let wr = ye;
|
|
774
|
+
class Ee extends ge {
|
|
775
775
|
type;
|
|
776
776
|
isNewProfile;
|
|
777
777
|
constructor(e) {
|
|
778
|
-
super(e), this.type =
|
|
778
|
+
super(e), this.type = fe.PROFILE, this.isNewProfile = e.isNewProfile || !1;
|
|
779
779
|
}
|
|
780
|
-
static newInstance = () => new
|
|
781
|
-
id:
|
|
780
|
+
static newInstance = () => new Ee({
|
|
781
|
+
id: Z(),
|
|
782
782
|
isNewProfile: !0
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
class
|
|
785
|
+
class We {
|
|
786
786
|
id;
|
|
787
787
|
code;
|
|
788
788
|
version;
|
|
@@ -792,25 +792,25 @@ class Ve {
|
|
|
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 xe(e.group) : void 0;
|
|
796
796
|
}
|
|
797
|
-
static newInstance = (e) => new
|
|
798
|
-
id:
|
|
797
|
+
static newInstance = (e) => new We({
|
|
798
|
+
id: Z(),
|
|
799
799
|
group: e
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
|
-
class
|
|
802
|
+
class xe extends ge {
|
|
803
803
|
type;
|
|
804
804
|
isNewGroup;
|
|
805
805
|
constructor(e) {
|
|
806
|
-
super(e), this.type =
|
|
806
|
+
super(e), this.type = fe.GROUP, this.isNewGroup = e.isNewGroup || !1;
|
|
807
807
|
}
|
|
808
|
-
static newInstance = () => new
|
|
809
|
-
id:
|
|
808
|
+
static newInstance = () => new xe({
|
|
809
|
+
id: Z(),
|
|
810
810
|
isNewGroup: !0
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
const
|
|
813
|
+
const _e = class Et {
|
|
814
814
|
id;
|
|
815
815
|
code;
|
|
816
816
|
version;
|
|
@@ -827,28 +827,28 @@ const De = class At {
|
|
|
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 Et({
|
|
831
|
+
id: Z(),
|
|
832
832
|
actions: [],
|
|
833
833
|
active: !0,
|
|
834
834
|
isNewResource: !0
|
|
835
835
|
});
|
|
836
836
|
};
|
|
837
|
-
|
|
838
|
-
|
|
837
|
+
k([
|
|
838
|
+
Q({
|
|
839
839
|
message: "archbase:Informe o nome para o recurso"
|
|
840
840
|
})
|
|
841
|
-
],
|
|
842
|
-
|
|
843
|
-
|
|
841
|
+
], _e.prototype, "name");
|
|
842
|
+
k([
|
|
843
|
+
Q({
|
|
844
844
|
message: "archbase:Informe a descrição para o recurso"
|
|
845
845
|
})
|
|
846
|
-
],
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
],
|
|
850
|
-
let
|
|
851
|
-
const
|
|
846
|
+
], _e.prototype, "description");
|
|
847
|
+
k([
|
|
848
|
+
re()
|
|
849
|
+
], _e.prototype, "active");
|
|
850
|
+
let xt = _e;
|
|
851
|
+
const H = class kt extends ge {
|
|
852
852
|
userName;
|
|
853
853
|
password;
|
|
854
854
|
changePasswordOnNextLogin;
|
|
@@ -868,10 +868,10 @@ const W = class xt extends me {
|
|
|
868
868
|
type;
|
|
869
869
|
isNewUser;
|
|
870
870
|
constructor(e) {
|
|
871
|
-
super(e), this.type =
|
|
871
|
+
super(e), this.type = fe.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.accountDeactivated = e.accountDeactivated || !1, this.accountLocked = e.accountLocked || !1, this.unlimitedAccessHours = e.unlimitedAccessHours || !1, this.isAdministrator = e.isAdministrator || !1, this.accessSchedule = e.accessSchedule ? new vt(e.accessSchedule) : void 0, this.groups = e.groups ? e.groups.map((t) => new We(t)) : [], this.profile = e.profile ? new Ee(e.profile) : void 0, this.email = e.email || "", this.avatar = e.avatar || void 0, this.isNewUser = e.isNewUser || !1, this.nickname = e.nickname;
|
|
872
872
|
}
|
|
873
|
-
static newInstance = () => new
|
|
874
|
-
id:
|
|
873
|
+
static newInstance = () => new kt({
|
|
874
|
+
id: Z(),
|
|
875
875
|
userName: "",
|
|
876
876
|
password: "",
|
|
877
877
|
groups: [],
|
|
@@ -882,54 +882,54 @@ const W = class xt extends me {
|
|
|
882
882
|
isNewUser: !0
|
|
883
883
|
});
|
|
884
884
|
};
|
|
885
|
-
|
|
886
|
-
|
|
885
|
+
k([
|
|
886
|
+
Q({
|
|
887
887
|
message: "archbase:Informe o nome de usuário"
|
|
888
888
|
})
|
|
889
|
-
],
|
|
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
|
-
|
|
889
|
+
], H.prototype, "userName");
|
|
890
|
+
k([
|
|
891
|
+
re()
|
|
892
|
+
], H.prototype, "changePasswordOnNextLogin");
|
|
893
|
+
k([
|
|
894
|
+
re()
|
|
895
|
+
], H.prototype, "allowPasswordChange");
|
|
896
|
+
k([
|
|
897
|
+
re()
|
|
898
|
+
], H.prototype, "allowMultipleLogins");
|
|
899
|
+
k([
|
|
900
|
+
re()
|
|
901
|
+
], H.prototype, "passwordNeverExpires");
|
|
902
|
+
k([
|
|
903
|
+
re()
|
|
904
|
+
], H.prototype, "accountDeactivated");
|
|
905
|
+
k([
|
|
906
|
+
re()
|
|
907
|
+
], H.prototype, "accountLocked");
|
|
908
|
+
k([
|
|
909
|
+
re()
|
|
910
|
+
], H.prototype, "unlimitedAccessHours");
|
|
911
|
+
k([
|
|
912
|
+
re()
|
|
913
|
+
], H.prototype, "isAdministrator");
|
|
914
|
+
k([
|
|
915
|
+
de()
|
|
916
|
+
], H.prototype, "accessSchedule");
|
|
917
|
+
k([
|
|
918
|
+
de()
|
|
919
|
+
], H.prototype, "groups");
|
|
920
|
+
k([
|
|
921
|
+
de()
|
|
922
|
+
], H.prototype, "profile");
|
|
923
|
+
k([
|
|
924
924
|
$t(
|
|
925
925
|
{},
|
|
926
926
|
{
|
|
927
927
|
message: "archbase:Informe um email válido"
|
|
928
928
|
}
|
|
929
929
|
)
|
|
930
|
-
],
|
|
931
|
-
let
|
|
932
|
-
const
|
|
930
|
+
], H.prototype, "email");
|
|
931
|
+
let Re = H;
|
|
932
|
+
const He = class ze {
|
|
933
933
|
id;
|
|
934
934
|
code;
|
|
935
935
|
version;
|
|
@@ -943,35 +943,35 @@ const We = class $e {
|
|
|
943
943
|
companyId;
|
|
944
944
|
projectId;
|
|
945
945
|
constructor(e) {
|
|
946
|
-
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 ?
|
|
946
|
+
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 ? ze.createDtoFromJson(e.security) : void 0, this.action = e.action ? new wr(e.action) : void 0, this.tenantId = e.tenantId || "", this.companyId = e.companyId || "", this.projectId = e.projectId || "";
|
|
947
947
|
}
|
|
948
948
|
static createDtoFromJson(e) {
|
|
949
949
|
switch (e.type) {
|
|
950
950
|
case "profile":
|
|
951
|
-
return new
|
|
951
|
+
return new Ee(e);
|
|
952
952
|
case "group":
|
|
953
|
-
return new
|
|
953
|
+
return new xe(e);
|
|
954
954
|
case "user":
|
|
955
|
-
return new
|
|
955
|
+
return new Re(e);
|
|
956
956
|
default:
|
|
957
957
|
throw new Error("Unknown DTO type");
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
static newInstance = () => new
|
|
961
|
-
id:
|
|
960
|
+
static newInstance = () => new ze({
|
|
961
|
+
id: Z(),
|
|
962
962
|
tenantId: "",
|
|
963
963
|
companyId: "",
|
|
964
964
|
projectId: ""
|
|
965
965
|
});
|
|
966
966
|
};
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
],
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
],
|
|
973
|
-
let Fr =
|
|
974
|
-
class
|
|
967
|
+
k([
|
|
968
|
+
de()
|
|
969
|
+
], He.prototype, "security");
|
|
970
|
+
k([
|
|
971
|
+
de()
|
|
972
|
+
], He.prototype, "action");
|
|
973
|
+
let Fr = He;
|
|
974
|
+
class Ge {
|
|
975
975
|
id;
|
|
976
976
|
code;
|
|
977
977
|
version;
|
|
@@ -989,13 +989,13 @@ class He {
|
|
|
989
989
|
activated;
|
|
990
990
|
isNovoToken;
|
|
991
991
|
constructor(e) {
|
|
992
|
-
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
|
|
992
|
+
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 Re(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;
|
|
993
993
|
}
|
|
994
|
-
static newInstance = () => new
|
|
995
|
-
id:
|
|
994
|
+
static newInstance = () => new Ge({
|
|
995
|
+
id: Z()
|
|
996
996
|
});
|
|
997
997
|
}
|
|
998
|
-
class
|
|
998
|
+
class Je {
|
|
999
999
|
id;
|
|
1000
1000
|
code;
|
|
1001
1001
|
version;
|
|
@@ -1012,23 +1012,23 @@ class Ge {
|
|
|
1012
1012
|
user;
|
|
1013
1013
|
isNewAccessToken;
|
|
1014
1014
|
constructor(e) {
|
|
1015
|
-
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
|
|
1015
|
+
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 Re(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;
|
|
1016
1016
|
}
|
|
1017
|
-
static newInstance = () => new
|
|
1018
|
-
id:
|
|
1017
|
+
static newInstance = () => new Je({
|
|
1018
|
+
id: Z(),
|
|
1019
1019
|
active: !0,
|
|
1020
1020
|
isNewAccessToken: !0
|
|
1021
1021
|
});
|
|
1022
1022
|
}
|
|
1023
|
-
class
|
|
1023
|
+
class St extends me {
|
|
1024
1024
|
constructor(e) {
|
|
1025
1025
|
super(e);
|
|
1026
1026
|
}
|
|
1027
1027
|
configureHeaders() {
|
|
1028
|
-
return
|
|
1028
|
+
return J.getInstance().getHeaders();
|
|
1029
1029
|
}
|
|
1030
1030
|
transform(e) {
|
|
1031
|
-
return new
|
|
1031
|
+
return new Re(e);
|
|
1032
1032
|
}
|
|
1033
1033
|
getEndpoint() {
|
|
1034
1034
|
return "/api/v1/user";
|
|
@@ -1047,17 +1047,17 @@ class kt extends pe {
|
|
|
1047
1047
|
return this.transform(t);
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
class
|
|
1050
|
+
U.decorate(U.inject(X.ApiClient), St, 0);
|
|
1051
|
+
U.decorate(U.injectable(), St);
|
|
1052
|
+
class It extends me {
|
|
1053
1053
|
constructor(e) {
|
|
1054
1054
|
super(e);
|
|
1055
1055
|
}
|
|
1056
1056
|
configureHeaders() {
|
|
1057
|
-
return
|
|
1057
|
+
return J.getInstance().getHeaders();
|
|
1058
1058
|
}
|
|
1059
1059
|
transform(e) {
|
|
1060
|
-
return new
|
|
1060
|
+
return new xe(e);
|
|
1061
1061
|
}
|
|
1062
1062
|
getEndpoint() {
|
|
1063
1063
|
return "/api/v1/group";
|
|
@@ -1069,17 +1069,17 @@ class St extends pe {
|
|
|
1069
1069
|
return e.isNewGroup;
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
class
|
|
1072
|
+
U.decorate(U.inject(X.ApiClient), It, 0);
|
|
1073
|
+
U.decorate(U.injectable(), It);
|
|
1074
|
+
class Ct extends me {
|
|
1075
1075
|
constructor(e) {
|
|
1076
1076
|
super(e);
|
|
1077
1077
|
}
|
|
1078
1078
|
configureHeaders() {
|
|
1079
|
-
return
|
|
1079
|
+
return J.getInstance().getHeaders();
|
|
1080
1080
|
}
|
|
1081
1081
|
transform(e) {
|
|
1082
|
-
return new
|
|
1082
|
+
return new Ee(e);
|
|
1083
1083
|
}
|
|
1084
1084
|
getEndpoint() {
|
|
1085
1085
|
return "/api/v1/userProfile";
|
|
@@ -1091,17 +1091,17 @@ class It extends pe {
|
|
|
1091
1091
|
return e.isNewProfile;
|
|
1092
1092
|
}
|
|
1093
1093
|
}
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
class
|
|
1094
|
+
U.decorate(U.inject(X.ApiClient), Ct, 0);
|
|
1095
|
+
U.decorate(U.injectable(), Ct);
|
|
1096
|
+
class Pt extends me {
|
|
1097
1097
|
constructor(e) {
|
|
1098
1098
|
super(e);
|
|
1099
1099
|
}
|
|
1100
1100
|
configureHeaders() {
|
|
1101
|
-
return
|
|
1101
|
+
return J.getInstance().getHeaders();
|
|
1102
1102
|
}
|
|
1103
1103
|
transform(e) {
|
|
1104
|
-
return new
|
|
1104
|
+
return new Ge(e);
|
|
1105
1105
|
}
|
|
1106
1106
|
getEndpoint() {
|
|
1107
1107
|
return "/api/v1/apiToken";
|
|
@@ -1113,12 +1113,12 @@ class Ct extends pe {
|
|
|
1113
1113
|
return e.isNovoToken;
|
|
1114
1114
|
}
|
|
1115
1115
|
async create(e, t, s, o) {
|
|
1116
|
-
const
|
|
1116
|
+
const a = await this.client.post(
|
|
1117
1117
|
`${this.getEndpoint()}/create?email=${e}&expirationDate=${t}&name=${s}&description=${o}`,
|
|
1118
1118
|
void 0,
|
|
1119
1119
|
this.configureHeaders()
|
|
1120
1120
|
);
|
|
1121
|
-
return this.transform(
|
|
1121
|
+
return this.transform(a);
|
|
1122
1122
|
}
|
|
1123
1123
|
async revoke(e) {
|
|
1124
1124
|
await this.client.post(
|
|
@@ -1128,17 +1128,17 @@ class Ct extends pe {
|
|
|
1128
1128
|
);
|
|
1129
1129
|
}
|
|
1130
1130
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
class
|
|
1131
|
+
U.decorate(U.inject(X.ApiClient), Pt, 0);
|
|
1132
|
+
U.decorate(U.injectable(), Pt);
|
|
1133
|
+
class Tt extends me {
|
|
1134
1134
|
constructor(e) {
|
|
1135
1135
|
super(e);
|
|
1136
1136
|
}
|
|
1137
1137
|
configureHeaders() {
|
|
1138
|
-
return
|
|
1138
|
+
return J.getInstance().getHeaders();
|
|
1139
1139
|
}
|
|
1140
1140
|
transform(e) {
|
|
1141
|
-
return new
|
|
1141
|
+
return new Je(e);
|
|
1142
1142
|
}
|
|
1143
1143
|
getEndpoint() {
|
|
1144
1144
|
return "/api/v1/accessToken";
|
|
@@ -1157,17 +1157,17 @@ class Pt extends pe {
|
|
|
1157
1157
|
);
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
class
|
|
1160
|
+
U.decorate(U.inject(X.ApiClient), Tt, 0);
|
|
1161
|
+
U.decorate(U.injectable(), Tt);
|
|
1162
|
+
class Ut extends me {
|
|
1163
1163
|
constructor(e) {
|
|
1164
1164
|
super(e);
|
|
1165
1165
|
}
|
|
1166
1166
|
configureHeaders() {
|
|
1167
|
-
return
|
|
1167
|
+
return J.getInstance().getHeaders();
|
|
1168
1168
|
}
|
|
1169
1169
|
transform(e) {
|
|
1170
|
-
return new
|
|
1170
|
+
return new xt(e);
|
|
1171
1171
|
}
|
|
1172
1172
|
getEndpoint() {
|
|
1173
1173
|
return "/api/v1/resource";
|
|
@@ -1191,7 +1191,7 @@ class Tt extends pe {
|
|
|
1191
1191
|
!1,
|
|
1192
1192
|
{
|
|
1193
1193
|
params: {
|
|
1194
|
-
type: Ye(
|
|
1194
|
+
type: Ye(fe, t)
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
1197
|
);
|
|
@@ -1202,7 +1202,7 @@ class Tt extends pe {
|
|
|
1202
1202
|
{
|
|
1203
1203
|
securityId: e,
|
|
1204
1204
|
actionId: t,
|
|
1205
|
-
type: Ye(
|
|
1205
|
+
type: Ye(fe, s)
|
|
1206
1206
|
},
|
|
1207
1207
|
this.configureHeaders()
|
|
1208
1208
|
);
|
|
@@ -1221,134 +1221,134 @@ class Tt extends pe {
|
|
|
1221
1221
|
);
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1224
|
+
U.decorate(U.inject(X.ApiClient), Ut, 0);
|
|
1225
|
+
U.decorate(U.injectable(), Ut);
|
|
1226
1226
|
function Vr({
|
|
1227
1227
|
onLogin: r,
|
|
1228
1228
|
error: e,
|
|
1229
1229
|
onClickForgotPassword: t,
|
|
1230
1230
|
loginLabel: s = "Email",
|
|
1231
1231
|
loginPlaceholder: o,
|
|
1232
|
-
afterInputs:
|
|
1233
|
-
showMockUsersSelector:
|
|
1234
|
-
mockUsers:
|
|
1235
|
-
mockUsersGroupMap:
|
|
1236
|
-
options:
|
|
1237
|
-
onChangeUsername:
|
|
1238
|
-
disabledLogin:
|
|
1239
|
-
isCheckingUsername:
|
|
1232
|
+
afterInputs: a,
|
|
1233
|
+
showMockUsersSelector: c = !1,
|
|
1234
|
+
mockUsers: i = [],
|
|
1235
|
+
mockUsersGroupMap: l,
|
|
1236
|
+
options: g = {},
|
|
1237
|
+
onChangeUsername: E,
|
|
1238
|
+
disabledLogin: d = !1,
|
|
1239
|
+
isCheckingUsername: _ = !1,
|
|
1240
1240
|
showSignIn: v = !0,
|
|
1241
|
-
mfaRequired:
|
|
1241
|
+
mfaRequired: f = !1,
|
|
1242
1242
|
onVerifyMfa: S,
|
|
1243
|
-
mfaError:
|
|
1243
|
+
mfaError: D,
|
|
1244
1244
|
onCancelMfa: B,
|
|
1245
|
-
isVerifyingMfa:
|
|
1245
|
+
isVerifyingMfa: O = !1
|
|
1246
1246
|
}) {
|
|
1247
|
-
const
|
|
1248
|
-
username:
|
|
1249
|
-
password:
|
|
1250
|
-
rememberMe:
|
|
1251
|
-
clearRememberMe:
|
|
1252
|
-
} = zt(), [
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
}, [e]),
|
|
1256
|
-
|
|
1257
|
-
}, [
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1260
|
-
},
|
|
1261
|
-
|
|
1262
|
-
},
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1265
|
-
},
|
|
1266
|
-
if (!
|
|
1267
|
-
return
|
|
1268
|
-
value:
|
|
1269
|
-
label:
|
|
1247
|
+
const F = lt(), {
|
|
1248
|
+
username: N,
|
|
1249
|
+
password: w,
|
|
1250
|
+
rememberMe: m,
|
|
1251
|
+
clearRememberMe: R
|
|
1252
|
+
} = zt(), [V, C] = h(N), [L, q] = h(w), [ee, Y] = h(m), [ie, p] = h(!1), [y, te] = h(null), [T, ue] = h("");
|
|
1253
|
+
K(() => {
|
|
1254
|
+
p(!!e);
|
|
1255
|
+
}, [e]), K(() => {
|
|
1256
|
+
N !== V && (C(N), E?.(N)), w !== L && q(w), m !== ee && Y(m);
|
|
1257
|
+
}, [N, w, m]);
|
|
1258
|
+
const se = () => {
|
|
1259
|
+
p(!1);
|
|
1260
|
+
}, we = () => {
|
|
1261
|
+
V && L && r(V, L, ee).finally(() => p(!0));
|
|
1262
|
+
}, u = () => {
|
|
1263
|
+
const A = T.trim();
|
|
1264
|
+
A && S && S(A);
|
|
1265
|
+
}, b = () => {
|
|
1266
|
+
if (!l)
|
|
1267
|
+
return i.map((M) => ({
|
|
1268
|
+
value: M.email,
|
|
1269
|
+
label: M.email
|
|
1270
1270
|
}));
|
|
1271
|
-
const
|
|
1272
|
-
const
|
|
1273
|
-
return
|
|
1274
|
-
value:
|
|
1275
|
-
label:
|
|
1276
|
-
})),
|
|
1271
|
+
const A = i.reduce((M, ve) => {
|
|
1272
|
+
const ke = l[ve.type];
|
|
1273
|
+
return ke && (M[ke] || (M[ke] = []), M[ke].push({
|
|
1274
|
+
value: ve.email,
|
|
1275
|
+
label: ve.email
|
|
1276
|
+
})), M;
|
|
1277
1277
|
}, {});
|
|
1278
|
-
return Object.entries(
|
|
1279
|
-
group:
|
|
1280
|
-
items:
|
|
1278
|
+
return Object.entries(A).map(([M, ve]) => ({
|
|
1279
|
+
group: M,
|
|
1280
|
+
items: ve
|
|
1281
1281
|
}));
|
|
1282
|
-
},
|
|
1283
|
-
if (
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1282
|
+
}, I = () => {
|
|
1283
|
+
if (y) {
|
|
1284
|
+
const A = i.find((M) => M.email === y);
|
|
1285
|
+
A && (C(A.email), q(A.password), se());
|
|
1286
1286
|
}
|
|
1287
|
-
},
|
|
1287
|
+
}, $ = {
|
|
1288
1288
|
withBorder: !0,
|
|
1289
1289
|
shadow: "md",
|
|
1290
1290
|
p: 30,
|
|
1291
1291
|
mt: 30,
|
|
1292
1292
|
radius: "md",
|
|
1293
1293
|
w: 400,
|
|
1294
|
-
...
|
|
1294
|
+
...g.cardProps
|
|
1295
1295
|
};
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
|
|
1296
|
+
return /* @__PURE__ */ P(
|
|
1297
|
+
Ve,
|
|
1298
1298
|
{
|
|
1299
|
-
|
|
1299
|
+
...$,
|
|
1300
1300
|
pos: "relative",
|
|
1301
|
-
ref:
|
|
1301
|
+
ref: F,
|
|
1302
1302
|
children: [
|
|
1303
|
-
v && /* @__PURE__ */
|
|
1303
|
+
v && /* @__PURE__ */ P(ne, { children: [
|
|
1304
1304
|
/* @__PURE__ */ n(
|
|
1305
|
-
|
|
1305
|
+
j,
|
|
1306
1306
|
{
|
|
1307
1307
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1308
1308
|
fw: 800,
|
|
1309
1309
|
fz: { base: "20px", md: "35px" },
|
|
1310
1310
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1311
1311
|
mt: "xs",
|
|
1312
|
-
children:
|
|
1312
|
+
children: x().t("archbase:signIn")
|
|
1313
1313
|
}
|
|
1314
1314
|
),
|
|
1315
|
-
/* @__PURE__ */ n(
|
|
1315
|
+
/* @__PURE__ */ n(Te, { m: "md" })
|
|
1316
1316
|
] }),
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */ n(
|
|
1321
|
-
/* @__PURE__ */ n(
|
|
1317
|
+
g?.customContentBefore,
|
|
1318
|
+
f && /* @__PURE__ */ P(be, { gap: "md", children: [
|
|
1319
|
+
/* @__PURE__ */ P("div", { children: [
|
|
1320
|
+
/* @__PURE__ */ n(j, { fw: 700, fz: "lg", children: x().t("archbase:mfa.title", "Verificação em duas etapas") }),
|
|
1321
|
+
/* @__PURE__ */ n(j, { c: "dimmed", fz: "sm", children: x().t(
|
|
1322
1322
|
"archbase:mfa.subtitle",
|
|
1323
1323
|
"Digite o código do seu aplicativo autenticador (ou um código de recuperação)."
|
|
1324
1324
|
) })
|
|
1325
1325
|
] }),
|
|
1326
1326
|
/* @__PURE__ */ n(
|
|
1327
|
-
|
|
1327
|
+
Ae,
|
|
1328
1328
|
{
|
|
1329
|
-
label:
|
|
1329
|
+
label: x().t("archbase:mfa.code", "Código de verificação"),
|
|
1330
1330
|
placeholder: "000000",
|
|
1331
|
-
value:
|
|
1331
|
+
value: T,
|
|
1332
1332
|
autoFocus: !0,
|
|
1333
|
-
onChange: (
|
|
1334
|
-
onKeyDown: (
|
|
1335
|
-
|
|
1333
|
+
onChange: (A) => ue(A.currentTarget.value),
|
|
1334
|
+
onKeyDown: (A) => {
|
|
1335
|
+
A.key === "Enter" && u();
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
1338
|
),
|
|
1339
|
-
|
|
1339
|
+
D && /* @__PURE__ */ n(j, { c: "red", fz: "sm", children: D }),
|
|
1340
1340
|
/* @__PURE__ */ n(
|
|
1341
|
-
|
|
1341
|
+
W,
|
|
1342
1342
|
{
|
|
1343
1343
|
fullWidth: !0,
|
|
1344
|
-
disabled: !
|
|
1345
|
-
loading:
|
|
1346
|
-
onClick:
|
|
1347
|
-
children:
|
|
1344
|
+
disabled: !T.trim() || O,
|
|
1345
|
+
loading: O,
|
|
1346
|
+
onClick: u,
|
|
1347
|
+
children: x().t("archbase:mfa.verify", "Verificar")
|
|
1348
1348
|
}
|
|
1349
1349
|
),
|
|
1350
1350
|
B && /* @__PURE__ */ n(
|
|
1351
|
-
|
|
1351
|
+
Qe,
|
|
1352
1352
|
{
|
|
1353
1353
|
component: "button",
|
|
1354
1354
|
c: "var(--mantine-text-color)",
|
|
@@ -1356,79 +1356,79 @@ function Vr({
|
|
|
1356
1356
|
ta: "center",
|
|
1357
1357
|
styles: { root: { cursor: "pointer" } },
|
|
1358
1358
|
onClick: B,
|
|
1359
|
-
children:
|
|
1359
|
+
children: x().t("archbase:mfa.back", "Voltar ao login")
|
|
1360
1360
|
}
|
|
1361
1361
|
)
|
|
1362
1362
|
] }),
|
|
1363
|
-
!
|
|
1364
|
-
|
|
1365
|
-
/* @__PURE__ */
|
|
1363
|
+
!f && /* @__PURE__ */ P(ne, { children: [
|
|
1364
|
+
c && /* @__PURE__ */ P(ne, { children: [
|
|
1365
|
+
/* @__PURE__ */ P(le, { gap: "sm", mb: "md", children: [
|
|
1366
1366
|
/* @__PURE__ */ n(
|
|
1367
1367
|
Ht,
|
|
1368
1368
|
{
|
|
1369
1369
|
placeholder: "Selecione um usuário mock",
|
|
1370
|
-
data:
|
|
1371
|
-
value:
|
|
1372
|
-
onChange: (
|
|
1370
|
+
data: b(),
|
|
1371
|
+
value: y,
|
|
1372
|
+
onChange: (A) => te(A ?? ""),
|
|
1373
1373
|
searchable: !0,
|
|
1374
1374
|
clearable: !0,
|
|
1375
1375
|
style: { flexGrow: 1 }
|
|
1376
1376
|
}
|
|
1377
1377
|
),
|
|
1378
1378
|
/* @__PURE__ */ n(Gt, { label: "Aplicar", children: /* @__PURE__ */ n(
|
|
1379
|
-
|
|
1379
|
+
W,
|
|
1380
1380
|
{
|
|
1381
1381
|
variant: "light",
|
|
1382
1382
|
size: "sm",
|
|
1383
|
-
onClick:
|
|
1384
|
-
disabled: !
|
|
1383
|
+
onClick: I,
|
|
1384
|
+
disabled: !y,
|
|
1385
1385
|
"aria-label": "Aplicar usuário mock selecionado",
|
|
1386
1386
|
children: /* @__PURE__ */ n(Xt, { size: 16 })
|
|
1387
1387
|
}
|
|
1388
1388
|
) })
|
|
1389
1389
|
] }),
|
|
1390
|
-
/* @__PURE__ */ n(
|
|
1390
|
+
/* @__PURE__ */ n(Te, { mb: "md" })
|
|
1391
1391
|
] }),
|
|
1392
1392
|
/* @__PURE__ */ n(
|
|
1393
|
-
|
|
1393
|
+
Ae,
|
|
1394
1394
|
{
|
|
1395
1395
|
label: s,
|
|
1396
|
-
placeholder: o ??
|
|
1397
|
-
rightSection:
|
|
1398
|
-
value:
|
|
1396
|
+
placeholder: o ?? x().t("archbase:usuario@email.com"),
|
|
1397
|
+
rightSection: _ ? /* @__PURE__ */ n(ct, { size: "xs" }) : null,
|
|
1398
|
+
value: V || "",
|
|
1399
1399
|
required: !0,
|
|
1400
|
-
onChange: (
|
|
1401
|
-
|
|
1400
|
+
onChange: (A) => {
|
|
1401
|
+
C(A.currentTarget.value), E?.(A.currentTarget.value), se();
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
1404
|
),
|
|
1405
1405
|
/* @__PURE__ */ n(
|
|
1406
|
-
|
|
1406
|
+
Le,
|
|
1407
1407
|
{
|
|
1408
|
-
label:
|
|
1409
|
-
placeholder:
|
|
1410
|
-
onChange: (
|
|
1411
|
-
|
|
1408
|
+
label: x().t("archbase:Password"),
|
|
1409
|
+
placeholder: x().t("archbase:Sua senha"),
|
|
1410
|
+
onChange: (A) => {
|
|
1411
|
+
q(A.currentTarget.value), se();
|
|
1412
1412
|
},
|
|
1413
|
-
value:
|
|
1413
|
+
value: L || "",
|
|
1414
1414
|
required: !0,
|
|
1415
1415
|
mt: "md"
|
|
1416
1416
|
}
|
|
1417
1417
|
),
|
|
1418
|
-
/* @__PURE__ */
|
|
1418
|
+
/* @__PURE__ */ P(le, { justify: "space-between", mt: "md", children: [
|
|
1419
1419
|
/* @__PURE__ */ n(
|
|
1420
1420
|
Jt,
|
|
1421
1421
|
{
|
|
1422
|
-
label:
|
|
1423
|
-
checked:
|
|
1424
|
-
onChange: (
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1422
|
+
label: x().t("archbase:Lembre-me"),
|
|
1423
|
+
checked: ee,
|
|
1424
|
+
onChange: (A) => {
|
|
1425
|
+
const M = A.currentTarget.checked;
|
|
1426
|
+
Y(M), M || R();
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
1429
|
),
|
|
1430
1430
|
t && /* @__PURE__ */ n(
|
|
1431
|
-
|
|
1431
|
+
Qe,
|
|
1432
1432
|
{
|
|
1433
1433
|
component: "button",
|
|
1434
1434
|
c: "var(--mantine-text-color)",
|
|
@@ -1436,29 +1436,29 @@ function Vr({
|
|
|
1436
1436
|
lh: "20px",
|
|
1437
1437
|
styles: { root: { cursor: "pointer" } },
|
|
1438
1438
|
onClick: t,
|
|
1439
|
-
children:
|
|
1439
|
+
children: x().t("archbase:Esqueci minha senha")
|
|
1440
1440
|
}
|
|
1441
1441
|
)
|
|
1442
1442
|
] }),
|
|
1443
|
-
|
|
1443
|
+
g?.afterInputs || a,
|
|
1444
1444
|
/* @__PURE__ */ n(
|
|
1445
|
-
|
|
1445
|
+
W,
|
|
1446
1446
|
{
|
|
1447
|
-
disabled: !
|
|
1447
|
+
disabled: !L || !V || d,
|
|
1448
1448
|
fullWidth: !0,
|
|
1449
1449
|
mt: "xl",
|
|
1450
|
-
onClick:
|
|
1451
|
-
children:
|
|
1450
|
+
onClick: we,
|
|
1451
|
+
children: x().t("archbase:signIn")
|
|
1452
1452
|
}
|
|
1453
1453
|
)
|
|
1454
1454
|
] }),
|
|
1455
|
-
|
|
1456
|
-
|
|
1455
|
+
g?.customContentAfter,
|
|
1456
|
+
ie && e && /* @__PURE__ */ n(j, { c: "red", mt: "sm", children: e })
|
|
1457
1457
|
]
|
|
1458
1458
|
}
|
|
1459
1459
|
);
|
|
1460
1460
|
}
|
|
1461
|
-
const
|
|
1461
|
+
const z = (r, e) => x().t(r, e);
|
|
1462
1462
|
function Wr({
|
|
1463
1463
|
enabled: r,
|
|
1464
1464
|
onSetup: e,
|
|
@@ -1466,94 +1466,94 @@ function Wr({
|
|
|
1466
1466
|
onDisable: s,
|
|
1467
1467
|
onStatusChange: o
|
|
1468
1468
|
}) {
|
|
1469
|
-
const [
|
|
1470
|
-
|
|
1469
|
+
const [a, c] = h("idle"), [i, l] = h(null), [g, E] = h(""), [d, _] = h([]), [v, f] = h(!1), [S, D] = h(null), B = async () => {
|
|
1470
|
+
f(!0), D(null);
|
|
1471
1471
|
try {
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
} catch (
|
|
1475
|
-
|
|
1472
|
+
const w = await e();
|
|
1473
|
+
l(w), E(""), c("setup");
|
|
1474
|
+
} catch (w) {
|
|
1475
|
+
D(w?.message || String(w));
|
|
1476
1476
|
} finally {
|
|
1477
|
-
|
|
1477
|
+
f(!1);
|
|
1478
1478
|
}
|
|
1479
|
-
},
|
|
1480
|
-
const
|
|
1481
|
-
if (
|
|
1482
|
-
|
|
1479
|
+
}, O = async () => {
|
|
1480
|
+
const w = g.trim();
|
|
1481
|
+
if (w) {
|
|
1482
|
+
f(!0), D(null);
|
|
1483
1483
|
try {
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
} catch (
|
|
1487
|
-
|
|
1484
|
+
const m = await t(w);
|
|
1485
|
+
_(m), c("recovery"), o?.(!0);
|
|
1486
|
+
} catch (m) {
|
|
1487
|
+
D(m?.message || String(m));
|
|
1488
1488
|
} finally {
|
|
1489
|
-
|
|
1489
|
+
f(!1);
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
},
|
|
1493
|
-
|
|
1492
|
+
}, F = async () => {
|
|
1493
|
+
f(!0), D(null);
|
|
1494
1494
|
try {
|
|
1495
|
-
await s(),
|
|
1496
|
-
} catch (
|
|
1497
|
-
|
|
1495
|
+
await s(), l(null), _([]), c("idle"), o?.(!1);
|
|
1496
|
+
} catch (w) {
|
|
1497
|
+
D(w?.message || String(w));
|
|
1498
1498
|
} finally {
|
|
1499
|
-
|
|
1499
|
+
f(!1);
|
|
1500
1500
|
}
|
|
1501
|
-
},
|
|
1502
|
-
|
|
1501
|
+
}, N = () => {
|
|
1502
|
+
_([]), l(null), E(""), c("idle");
|
|
1503
1503
|
};
|
|
1504
|
-
return /* @__PURE__ */ n(
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
/* @__PURE__ */ n(
|
|
1507
|
-
/* @__PURE__ */ n(
|
|
1504
|
+
return /* @__PURE__ */ n(Ve, { withBorder: !0, radius: "md", p: "lg", children: /* @__PURE__ */ P(be, { gap: "md", children: [
|
|
1505
|
+
/* @__PURE__ */ P("div", { children: [
|
|
1506
|
+
/* @__PURE__ */ n(j, { fw: 700, fz: "lg", children: z("archbase:mfa.setup.title", "Autenticação em duas etapas (MFA)") }),
|
|
1507
|
+
/* @__PURE__ */ n(j, { c: "dimmed", fz: "sm", children: z(
|
|
1508
1508
|
"archbase:mfa.setup.subtitle",
|
|
1509
1509
|
"Proteja o acesso exigindo um código do seu aplicativo autenticador no login."
|
|
1510
1510
|
) })
|
|
1511
1511
|
] }),
|
|
1512
|
-
S && /* @__PURE__ */ n(
|
|
1513
|
-
r &&
|
|
1514
|
-
/* @__PURE__ */ n(
|
|
1515
|
-
/* @__PURE__ */ n(
|
|
1512
|
+
S && /* @__PURE__ */ n(Ze, { color: "red", children: S }),
|
|
1513
|
+
r && a === "idle" && /* @__PURE__ */ P(le, { justify: "space-between", children: [
|
|
1514
|
+
/* @__PURE__ */ n(j, { c: "teal", fw: 600, children: z("archbase:mfa.setup.active", "MFA ativo") }),
|
|
1515
|
+
/* @__PURE__ */ n(W, { color: "red", variant: "light", loading: v, onClick: F, children: z("archbase:mfa.setup.disable", "Desativar") })
|
|
1516
1516
|
] }),
|
|
1517
|
-
!r &&
|
|
1518
|
-
|
|
1519
|
-
/* @__PURE__ */ n(
|
|
1517
|
+
!r && a === "idle" && /* @__PURE__ */ n(W, { loading: v, onClick: B, children: z("archbase:mfa.setup.enable", "Ativar MFA") }),
|
|
1518
|
+
a === "setup" && i && /* @__PURE__ */ P(be, { gap: "sm", align: "center", children: [
|
|
1519
|
+
/* @__PURE__ */ n(j, { fz: "sm", ta: "center", children: z(
|
|
1520
1520
|
"archbase:mfa.setup.scan",
|
|
1521
1521
|
"Escaneie o QR Code no seu app autenticador (Google Authenticator, Authy…):"
|
|
1522
1522
|
) }),
|
|
1523
|
-
/* @__PURE__ */ n(Qt, { value:
|
|
1524
|
-
/* @__PURE__ */ n(
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */ n(
|
|
1527
|
-
/* @__PURE__ */ n(
|
|
1523
|
+
/* @__PURE__ */ n(Qt, { value: i.provisioningUri, size: 180, level: "M" }),
|
|
1524
|
+
/* @__PURE__ */ n(j, { fz: "xs", c: "dimmed", ta: "center", children: z("archbase:mfa.setup.manual", "Ou informe o código manualmente:") }),
|
|
1525
|
+
/* @__PURE__ */ P(le, { gap: "xs", children: [
|
|
1526
|
+
/* @__PURE__ */ n(et, { children: i.secret }),
|
|
1527
|
+
/* @__PURE__ */ n(tt, { value: i.secret, children: ({ copied: w, copy: m }) => /* @__PURE__ */ n(W, { size: "xs", variant: "subtle", onClick: m, children: w ? z("archbase:mfa.setup.copied", "Copiado") : z("archbase:mfa.setup.copy", "Copiar") }) })
|
|
1528
1528
|
] }),
|
|
1529
1529
|
/* @__PURE__ */ n(
|
|
1530
|
-
|
|
1530
|
+
Ae,
|
|
1531
1531
|
{
|
|
1532
1532
|
w: "100%",
|
|
1533
|
-
label:
|
|
1533
|
+
label: z("archbase:mfa.setup.confirmCode", "Digite o código gerado para confirmar"),
|
|
1534
1534
|
placeholder: "000000",
|
|
1535
|
-
value:
|
|
1536
|
-
onChange: (
|
|
1537
|
-
onKeyDown: (
|
|
1538
|
-
|
|
1535
|
+
value: g,
|
|
1536
|
+
onChange: (w) => E(w.currentTarget.value),
|
|
1537
|
+
onKeyDown: (w) => {
|
|
1538
|
+
w.key === "Enter" && O();
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
1541
|
),
|
|
1542
|
-
/* @__PURE__ */
|
|
1543
|
-
/* @__PURE__ */ n(
|
|
1544
|
-
/* @__PURE__ */ n(
|
|
1542
|
+
/* @__PURE__ */ P(le, { w: "100%", justify: "flex-end", children: [
|
|
1543
|
+
/* @__PURE__ */ n(W, { variant: "default", onClick: N, disabled: v, children: z("archbase:mfa.setup.cancel", "Cancelar") }),
|
|
1544
|
+
/* @__PURE__ */ n(W, { onClick: O, loading: v, disabled: !g.trim(), children: z("archbase:mfa.setup.confirm", "Confirmar e ativar") })
|
|
1545
1545
|
] })
|
|
1546
1546
|
] }),
|
|
1547
|
-
|
|
1548
|
-
/* @__PURE__ */ n(
|
|
1547
|
+
a === "recovery" && /* @__PURE__ */ P(be, { gap: "sm", children: [
|
|
1548
|
+
/* @__PURE__ */ n(Ze, { color: "yellow", children: z(
|
|
1549
1549
|
"archbase:mfa.setup.recoveryWarning",
|
|
1550
1550
|
"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."
|
|
1551
1551
|
) }),
|
|
1552
|
-
/* @__PURE__ */ n(Kt, { cols: 2, spacing: "xs", children:
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */ n(
|
|
1555
|
-
`), children: ({ copied:
|
|
1556
|
-
/* @__PURE__ */ n(
|
|
1552
|
+
/* @__PURE__ */ n(Kt, { cols: 2, spacing: "xs", children: d.map((w) => /* @__PURE__ */ n(et, { fz: "sm", children: w }, w)) }),
|
|
1553
|
+
/* @__PURE__ */ P(le, { justify: "space-between", children: [
|
|
1554
|
+
/* @__PURE__ */ n(tt, { value: d.join(`
|
|
1555
|
+
`), children: ({ copied: w, copy: m }) => /* @__PURE__ */ n(W, { variant: "subtle", onClick: m, children: w ? z("archbase:mfa.setup.copied", "Copiado") : z("archbase:mfa.setup.copyAll", "Copiar todos") }) }),
|
|
1556
|
+
/* @__PURE__ */ n(W, { onClick: N, children: z("archbase:mfa.setup.done", "Guardei os códigos") })
|
|
1557
1557
|
] })
|
|
1558
1558
|
] })
|
|
1559
1559
|
] }) });
|
|
@@ -1565,348 +1565,371 @@ const vr = {
|
|
|
1565
1565
|
padding: 30,
|
|
1566
1566
|
marginTop: 30
|
|
1567
1567
|
};
|
|
1568
|
-
function Hr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClickBackToLogin: s, validatePassword: o, validateToken:
|
|
1569
|
-
const
|
|
1570
|
-
async function
|
|
1571
|
-
|
|
1572
|
-
|
|
1568
|
+
function Hr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClickBackToLogin: s, validatePassword: o, validateToken: a, initialEmail: c = "", description: i, style: l }) {
|
|
1569
|
+
const g = lt(), E = jt(), { colorScheme: d } = qt(), [_, v] = h(r ?? ""), [f, S] = h(c), [D, B] = h(""), [O, F] = h(""), [N, w] = h(""), [m, R] = h(!1), [V, C] = h(""), [L, q] = h(""), [ee, Y] = h(""), [ie, p] = h("");
|
|
1570
|
+
async function y(T) {
|
|
1571
|
+
T && (Ft(T) ? await e(T).then(() => {
|
|
1572
|
+
rt.showSuccess(`${x().t("archbase:Um e-mail com instruções para redefinir sua senha foi enviado. Verifique sua caixa de entrada.")}`), R(!0);
|
|
1573
1573
|
}).catch(() => {
|
|
1574
|
-
}) :
|
|
1574
|
+
}) : C(`${x().t("archbase:Email inválido")}`));
|
|
1575
1575
|
}
|
|
1576
|
-
async function
|
|
1577
|
-
if (
|
|
1578
|
-
let
|
|
1579
|
-
|
|
1580
|
-
|
|
1576
|
+
async function te(T, ue, se, we) {
|
|
1577
|
+
if (T && ue && se) {
|
|
1578
|
+
let u = "", b = "", I = "";
|
|
1579
|
+
a && (u = a(), Y(u)), o && (b = o(), Y(b)), se !== we && (I = `${x().t("archbase:A nova senha e a confirmação devem ser iguais.")}`, p(I)), !b && !u && await t(T, ue, se).then(() => {
|
|
1580
|
+
rt.showSuccess(`${x().t("archbase:Senha redefinida com sucesso.")}`), s(), R(!1);
|
|
1581
1581
|
}).catch(() => {
|
|
1582
|
-
v(r || `${
|
|
1582
|
+
v(r || `${x().t("archbase:Erro ao redefinir senha.")}`);
|
|
1583
1583
|
});
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
|
-
return
|
|
1586
|
+
return K(() => {
|
|
1587
1587
|
r && v(r);
|
|
1588
|
-
}, [r]),
|
|
1588
|
+
}, [r]), K(() => {
|
|
1589
1589
|
v("");
|
|
1590
|
-
}, [
|
|
1591
|
-
|
|
1590
|
+
}, [f, D, O, N]), /* @__PURE__ */ P(
|
|
1591
|
+
Ve,
|
|
1592
1592
|
{
|
|
1593
1593
|
withBorder: !0,
|
|
1594
1594
|
shadow: "md",
|
|
1595
1595
|
radius: "md",
|
|
1596
|
-
ref:
|
|
1596
|
+
ref: g,
|
|
1597
1597
|
style: {
|
|
1598
1598
|
...vr,
|
|
1599
|
-
...
|
|
1599
|
+
...l
|
|
1600
1600
|
},
|
|
1601
1601
|
children: [
|
|
1602
|
-
|
|
1602
|
+
m ? /* @__PURE__ */ P(ne, { children: [
|
|
1603
1603
|
/* @__PURE__ */ n(
|
|
1604
|
-
|
|
1604
|
+
j,
|
|
1605
1605
|
{
|
|
1606
1606
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1607
1607
|
fw: 800,
|
|
1608
1608
|
fz: { base: "20px", md: "35px" },
|
|
1609
1609
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1610
1610
|
mt: "xs",
|
|
1611
|
-
children:
|
|
1611
|
+
children: x().t("archbase:Redefinir senha")
|
|
1612
1612
|
}
|
|
1613
1613
|
),
|
|
1614
|
-
/* @__PURE__ */ n(
|
|
1614
|
+
/* @__PURE__ */ n(Te, { m: "xs" }),
|
|
1615
1615
|
/* @__PURE__ */ n(
|
|
1616
|
-
|
|
1616
|
+
Ae,
|
|
1617
1617
|
{
|
|
1618
|
-
label:
|
|
1619
|
-
placeholder: `${
|
|
1620
|
-
value:
|
|
1618
|
+
label: x().t("archbase:Código de segurança"),
|
|
1619
|
+
placeholder: `${x().t("archbase:Código enviado no seu e-mail")}`,
|
|
1620
|
+
value: D || "",
|
|
1621
1621
|
required: !0,
|
|
1622
|
-
onChange: (
|
|
1623
|
-
B(
|
|
1622
|
+
onChange: (T) => {
|
|
1623
|
+
B(T.currentTarget.value), q("");
|
|
1624
1624
|
},
|
|
1625
|
-
error:
|
|
1625
|
+
error: L
|
|
1626
1626
|
}
|
|
1627
1627
|
),
|
|
1628
1628
|
/* @__PURE__ */ n(
|
|
1629
|
-
|
|
1629
|
+
Le,
|
|
1630
1630
|
{
|
|
1631
|
-
label:
|
|
1632
|
-
placeholder:
|
|
1633
|
-
onChange: (
|
|
1634
|
-
|
|
1631
|
+
label: x().t("archbase:Nova senha"),
|
|
1632
|
+
placeholder: x().t("archbase:Nova senha"),
|
|
1633
|
+
onChange: (T) => {
|
|
1634
|
+
F(T.currentTarget.value), Y(""), p("");
|
|
1635
1635
|
},
|
|
1636
|
-
value:
|
|
1636
|
+
value: O,
|
|
1637
1637
|
required: !0,
|
|
1638
|
-
error:
|
|
1638
|
+
error: ee
|
|
1639
1639
|
}
|
|
1640
1640
|
),
|
|
1641
1641
|
/* @__PURE__ */ n(
|
|
1642
|
-
|
|
1642
|
+
Le,
|
|
1643
1643
|
{
|
|
1644
|
-
label:
|
|
1645
|
-
placeholder:
|
|
1646
|
-
onChange: (
|
|
1647
|
-
|
|
1644
|
+
label: x().t("archbase:Confirmar senha"),
|
|
1645
|
+
placeholder: x().t("archbase:Confirmar senha"),
|
|
1646
|
+
onChange: (T) => {
|
|
1647
|
+
w(T.currentTarget.value), p("");
|
|
1648
1648
|
},
|
|
1649
|
-
value:
|
|
1649
|
+
value: N || "",
|
|
1650
1650
|
required: !0,
|
|
1651
|
-
error:
|
|
1651
|
+
error: ie
|
|
1652
1652
|
}
|
|
1653
1653
|
),
|
|
1654
1654
|
/* @__PURE__ */ n(
|
|
1655
|
-
|
|
1655
|
+
W,
|
|
1656
1656
|
{
|
|
1657
|
-
disabled: !
|
|
1657
|
+
disabled: !f || !D || !O || !N,
|
|
1658
1658
|
mt: "md",
|
|
1659
1659
|
fullWidth: !0,
|
|
1660
|
-
onClick: () =>
|
|
1661
|
-
children: `${
|
|
1660
|
+
onClick: () => te(f, D, O, N),
|
|
1661
|
+
children: `${x().t("archbase:Redefinir senha")}`
|
|
1662
1662
|
}
|
|
1663
1663
|
),
|
|
1664
1664
|
/* @__PURE__ */ n(
|
|
1665
|
-
|
|
1665
|
+
W,
|
|
1666
1666
|
{
|
|
1667
1667
|
mt: "6px",
|
|
1668
1668
|
fullWidth: !0,
|
|
1669
|
-
color:
|
|
1669
|
+
color: d === "dark" ? E.colors.dark[4] : E.colors.gray[7],
|
|
1670
1670
|
onClick: () => {
|
|
1671
|
-
|
|
1671
|
+
V || R(!1);
|
|
1672
1672
|
},
|
|
1673
|
-
children: `${
|
|
1673
|
+
children: `${x().t("archbase:Voltar")}`
|
|
1674
1674
|
}
|
|
1675
1675
|
)
|
|
1676
|
-
] }) : /* @__PURE__ */
|
|
1676
|
+
] }) : /* @__PURE__ */ P(ne, { children: [
|
|
1677
1677
|
/* @__PURE__ */ n(
|
|
1678
|
-
|
|
1678
|
+
j,
|
|
1679
1679
|
{
|
|
1680
1680
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1681
1681
|
fw: 800,
|
|
1682
1682
|
fz: { base: "20px", md: "35px" },
|
|
1683
1683
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1684
1684
|
mt: "xs",
|
|
1685
|
-
children:
|
|
1685
|
+
children: x().t("archbase:Redefinir senha")
|
|
1686
1686
|
}
|
|
1687
1687
|
),
|
|
1688
|
-
/* @__PURE__ */ n(
|
|
1689
|
-
/* @__PURE__ */ n(
|
|
1688
|
+
/* @__PURE__ */ n(j, { c: "dimmed", fz: 14, style: { textAlign: "justify" }, children: i }),
|
|
1689
|
+
/* @__PURE__ */ n(Te, { m: "md" }),
|
|
1690
1690
|
/* @__PURE__ */ n(
|
|
1691
|
-
|
|
1691
|
+
Ae,
|
|
1692
1692
|
{
|
|
1693
1693
|
label: "Email",
|
|
1694
|
-
placeholder: `${
|
|
1695
|
-
value:
|
|
1694
|
+
placeholder: `${x().t("archbase:usuario@email.com")}`,
|
|
1695
|
+
value: f || "",
|
|
1696
1696
|
required: !0,
|
|
1697
|
-
onChange: (
|
|
1698
|
-
S(
|
|
1697
|
+
onChange: (T) => {
|
|
1698
|
+
S(T.currentTarget.value), C("");
|
|
1699
1699
|
},
|
|
1700
|
-
error:
|
|
1700
|
+
error: V
|
|
1701
1701
|
}
|
|
1702
1702
|
),
|
|
1703
1703
|
/* @__PURE__ */ n(
|
|
1704
|
-
|
|
1704
|
+
W,
|
|
1705
1705
|
{
|
|
1706
|
-
disabled: !
|
|
1706
|
+
disabled: !f,
|
|
1707
1707
|
mt: "md",
|
|
1708
1708
|
fullWidth: !0,
|
|
1709
|
-
onClick: () =>
|
|
1710
|
-
children: `${
|
|
1709
|
+
onClick: () => y(f),
|
|
1710
|
+
children: `${x().t("archbase:Enviar")}`
|
|
1711
1711
|
}
|
|
1712
1712
|
),
|
|
1713
1713
|
/* @__PURE__ */ n(
|
|
1714
|
-
|
|
1714
|
+
W,
|
|
1715
1715
|
{
|
|
1716
1716
|
mt: "6px",
|
|
1717
1717
|
fullWidth: !0,
|
|
1718
|
-
color:
|
|
1718
|
+
color: d === "dark" ? E.colors.dark[4] : E.colors.gray[7],
|
|
1719
1719
|
onClick: () => s && s(),
|
|
1720
|
-
children: `${
|
|
1720
|
+
children: `${x().t("archbase:Voltar")}`
|
|
1721
1721
|
}
|
|
1722
1722
|
)
|
|
1723
1723
|
] }),
|
|
1724
|
-
|
|
1724
|
+
_ ? /* @__PURE__ */ n(j, { c: "red", style: { textAlign: "justify" }, children: _ }) : null
|
|
1725
1725
|
]
|
|
1726
1726
|
}
|
|
1727
1727
|
);
|
|
1728
1728
|
}
|
|
1729
|
-
const br = () => Vt().user,
|
|
1730
|
-
const s =
|
|
1729
|
+
const br = () => Vt().user, Dt = "archbaseSecurityManagerStore", Gr = ({ resourceName: r, resourceDescription: e, enableSecurity: t = !0 }) => {
|
|
1730
|
+
const s = at(Dt), o = br(), a = o?.isAdmin ?? !1, c = o?.id, i = it(c), l = nt(() => {
|
|
1731
1731
|
if (!t)
|
|
1732
1732
|
return null;
|
|
1733
|
-
const
|
|
1734
|
-
if (s && s.existsValue(
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1737
|
-
return
|
|
1733
|
+
const g = c ? `${r}_${c}` : r;
|
|
1734
|
+
if (s && s.existsValue(g)) {
|
|
1735
|
+
const d = s.getValue(g);
|
|
1736
|
+
if (d && d.isAdmin === a)
|
|
1737
|
+
return d;
|
|
1738
1738
|
}
|
|
1739
|
-
const
|
|
1740
|
-
return s &&
|
|
1741
|
-
}, [t, r, e,
|
|
1742
|
-
return
|
|
1743
|
-
|
|
1744
|
-
}, [
|
|
1739
|
+
const E = new gt(r, e, a);
|
|
1740
|
+
return s && c && s.setValue(g, E), E;
|
|
1741
|
+
}, [t, r, e, a, c]);
|
|
1742
|
+
return K(() => {
|
|
1743
|
+
i.current = c;
|
|
1744
|
+
}, [c]), { securityManager: l };
|
|
1745
1745
|
}, Jr = ({
|
|
1746
1746
|
checkIntervalTokenHasExpired: r = 3e4,
|
|
1747
1747
|
// Verificar a 30 segundos
|
|
1748
1748
|
expirationThresholdOfToken: e = 300
|
|
1749
1749
|
// Antecipar em 5 minutos
|
|
1750
1750
|
}) => {
|
|
1751
|
-
const t =
|
|
1752
|
-
(
|
|
1753
|
-
), s =
|
|
1754
|
-
(
|
|
1755
|
-
), [o,
|
|
1751
|
+
const t = Ue(
|
|
1752
|
+
(u) => u.get(X.TokenManager)
|
|
1753
|
+
), s = Ue(
|
|
1754
|
+
(u) => u.get(X.Authenticator)
|
|
1755
|
+
), [o, a] = h(null), [c, i] = h(!1), [l, g] = h(!0), [E, d] = h(!1), [_, v] = h(!1), [f, S] = h(""), [D, B] = h(""), [O, F] = h(null), [N, w] = h(!1), [m, R] = h(null), V = at(Dt), C = {
|
|
1756
1756
|
hasContextualLogin: typeof s.loginWithContext == "function",
|
|
1757
1757
|
hasFlexibleLogin: typeof s.loginFlexible == "function",
|
|
1758
1758
|
hasSocialLogin: typeof s.loginSocial == "function",
|
|
1759
1759
|
hasRegistration: typeof s.register == "function",
|
|
1760
1760
|
hasContextSupport: typeof t.saveContext == "function"
|
|
1761
1761
|
};
|
|
1762
|
-
|
|
1763
|
-
const
|
|
1764
|
-
if (
|
|
1765
|
-
const
|
|
1766
|
-
if (
|
|
1762
|
+
K(() => {
|
|
1763
|
+
const u = t.getUsername();
|
|
1764
|
+
if (u && u != "" && B(u), C.hasContextSupport && t.getContext) {
|
|
1765
|
+
const I = t.getContext();
|
|
1766
|
+
if (I)
|
|
1767
1767
|
try {
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1770
|
-
} catch (
|
|
1771
|
-
console.warn("Erro ao carregar contexto salvo:",
|
|
1768
|
+
const $ = typeof I == "string" ? JSON.parse(I) : I;
|
|
1769
|
+
F($);
|
|
1770
|
+
} catch ($) {
|
|
1771
|
+
console.warn("Erro ao carregar contexto salvo:", $);
|
|
1772
1772
|
}
|
|
1773
1773
|
}
|
|
1774
|
-
const
|
|
1775
|
-
|
|
1774
|
+
const b = t.getToken();
|
|
1775
|
+
b && (d(!0), S(""), v(!1), a(b)), g(!1);
|
|
1776
1776
|
}, []);
|
|
1777
|
-
const
|
|
1777
|
+
const L = () => {
|
|
1778
1778
|
v(!1), S("");
|
|
1779
|
-
},
|
|
1780
|
-
|
|
1781
|
-
},
|
|
1779
|
+
}, q = (u) => {
|
|
1780
|
+
i(!1), d(!1), t.clearToken(), u && t.clearUsernameAndPassword(), C.hasContextSupport && t.clearContext && t.clearContext(), B(""), F(null), S(""), v(!1), V.clearAllValues();
|
|
1781
|
+
}, ee = async (u, b, I) => {
|
|
1782
1782
|
try {
|
|
1783
|
-
|
|
1784
|
-
const
|
|
1785
|
-
t.saveToken(
|
|
1786
|
-
} catch (
|
|
1787
|
-
|
|
1783
|
+
i(!0), d(!1);
|
|
1784
|
+
const $ = await s.login(u, b);
|
|
1785
|
+
t.saveToken($), I && t.saveUsernameAndPassword(u, b), t.saveUsername(u), B(u), a($), i(!1), d(!0);
|
|
1786
|
+
} catch ($) {
|
|
1787
|
+
i(!1), d(!1), S(oe($)), v(!0);
|
|
1788
1788
|
}
|
|
1789
|
-
},
|
|
1790
|
-
if (!
|
|
1789
|
+
}, Y = async (u, b = !1) => {
|
|
1790
|
+
if (!C.hasContextualLogin || !s.loginWithContext)
|
|
1791
1791
|
throw new Error("Login contextual não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1792
1792
|
try {
|
|
1793
|
-
|
|
1794
|
-
const { context:
|
|
1793
|
+
i(!0), d(!1);
|
|
1794
|
+
const { context: I, user: $, ...A } = await s.loginWithContext(u);
|
|
1795
|
+
if (A.mfa_required) {
|
|
1796
|
+
R(A.challenge_token ?? null), w(!0), B(u.email), i(!1);
|
|
1797
|
+
return;
|
|
1798
|
+
}
|
|
1799
|
+
const M = {
|
|
1795
1800
|
scope: "",
|
|
1796
|
-
ext_expires_in:
|
|
1797
|
-
...
|
|
1801
|
+
ext_expires_in: A.expires_in,
|
|
1802
|
+
...A
|
|
1798
1803
|
};
|
|
1799
|
-
t.saveToken(
|
|
1800
|
-
} catch (
|
|
1801
|
-
throw
|
|
1804
|
+
t.saveToken(M), b ? t.saveUsernameAndPassword(u.email, u.password) : t.clearUsernameAndPassword(), t.saveUsername(u.email), C.hasContextSupport && t.saveContext && I && (t.saveContext(JSON.stringify(I)), F(I)), B(u.email), a(M), i(!1), d(!0);
|
|
1805
|
+
} catch (I) {
|
|
1806
|
+
throw i(!1), d(!1), S(oe(I)), v(!0), I;
|
|
1802
1807
|
}
|
|
1803
|
-
},
|
|
1804
|
-
if (!
|
|
1808
|
+
}, ie = async (u) => {
|
|
1809
|
+
if (!s.verifyMfa)
|
|
1810
|
+
throw new Error("verifyMfa não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1811
|
+
if (!m)
|
|
1812
|
+
throw new Error("Nenhum desafio de MFA pendente");
|
|
1813
|
+
try {
|
|
1814
|
+
i(!0), S(""), v(!1);
|
|
1815
|
+
const b = await s.verifyMfa(m, u);
|
|
1816
|
+
t.saveToken(b), t.saveUsername(D), a(b), w(!1), R(null), i(!1), d(!0);
|
|
1817
|
+
} catch (b) {
|
|
1818
|
+
throw i(!1), S(oe(b)), v(!0), b;
|
|
1819
|
+
}
|
|
1820
|
+
}, p = () => {
|
|
1821
|
+
w(!1), R(null), S(""), v(!1);
|
|
1822
|
+
}, y = async (u, b = !1) => {
|
|
1823
|
+
if (!C.hasFlexibleLogin || !s.loginFlexible)
|
|
1805
1824
|
throw new Error("Login flexível não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1806
1825
|
try {
|
|
1807
|
-
|
|
1808
|
-
const { context:
|
|
1826
|
+
i(!0), d(!1);
|
|
1827
|
+
const { context: I, user: $, ...A } = await s.loginFlexible(u), M = {
|
|
1809
1828
|
scope: "",
|
|
1810
|
-
ext_expires_in:
|
|
1811
|
-
...
|
|
1829
|
+
ext_expires_in: A.expires_in,
|
|
1830
|
+
...A
|
|
1812
1831
|
};
|
|
1813
|
-
t.saveToken(
|
|
1814
|
-
} catch (
|
|
1815
|
-
throw
|
|
1832
|
+
t.saveToken(M), b && t.saveUsernameAndPassword(u.identifier, u.password), t.saveUsername($.email || u.identifier), C.hasContextSupport && t.saveContext && I && (t.saveContext(JSON.stringify(I)), F(I)), B($.email || u.identifier), a(M), i(!1), d(!0);
|
|
1833
|
+
} catch (I) {
|
|
1834
|
+
throw i(!1), d(!1), S(oe(I)), v(!0), I;
|
|
1816
1835
|
}
|
|
1817
|
-
},
|
|
1818
|
-
if (!
|
|
1836
|
+
}, te = async (u) => {
|
|
1837
|
+
if (!C.hasSocialLogin || !s.loginSocial)
|
|
1819
1838
|
throw new Error("Login social não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1820
1839
|
try {
|
|
1821
|
-
|
|
1822
|
-
const { context:
|
|
1840
|
+
i(!0), d(!1);
|
|
1841
|
+
const { context: b, user: I, ...$ } = await s.loginSocial(u), A = {
|
|
1823
1842
|
scope: "",
|
|
1824
|
-
ext_expires_in:
|
|
1825
|
-
|
|
1843
|
+
ext_expires_in: $.expires_in,
|
|
1844
|
+
...$
|
|
1826
1845
|
};
|
|
1827
|
-
t.saveToken(
|
|
1828
|
-
} catch (
|
|
1829
|
-
throw
|
|
1846
|
+
t.saveToken(A), t.saveUsername(I.email), C.hasContextSupport && t.saveContext && b && (t.saveContext(JSON.stringify(b)), F(b)), B(I.email), a(A), i(!1), d(!0);
|
|
1847
|
+
} catch (b) {
|
|
1848
|
+
throw i(!1), d(!1), S(oe(b)), v(!0), b;
|
|
1830
1849
|
}
|
|
1831
|
-
},
|
|
1832
|
-
if (!
|
|
1850
|
+
}, T = async (u) => {
|
|
1851
|
+
if (!C.hasRegistration || !s.register)
|
|
1833
1852
|
throw new Error("Registro não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1834
1853
|
try {
|
|
1835
|
-
|
|
1836
|
-
const
|
|
1837
|
-
return
|
|
1838
|
-
} catch (
|
|
1839
|
-
throw
|
|
1854
|
+
i(!0);
|
|
1855
|
+
const b = await s.register(u);
|
|
1856
|
+
return i(!1), b;
|
|
1857
|
+
} catch (b) {
|
|
1858
|
+
throw i(!1), S(oe(b)), v(!0), b;
|
|
1840
1859
|
}
|
|
1841
|
-
},
|
|
1842
|
-
|
|
1843
|
-
const
|
|
1844
|
-
o && o.access_token && t.isTokenExpired(o, e) &&
|
|
1860
|
+
}, ue = async () => s.getSupportedContexts ? await s.getSupportedContexts() : { supportedContexts: ["DEFAULT"], defaultContext: "DEFAULT" }, se = async (u) => s.validateContext ? await s.validateContext(u) : { context: u, supported: u === "DEFAULT" };
|
|
1861
|
+
K(() => {
|
|
1862
|
+
const u = setInterval(() => {
|
|
1863
|
+
o && o.access_token && t.isTokenExpired(o, e) && we();
|
|
1845
1864
|
}, r);
|
|
1846
1865
|
return () => {
|
|
1847
|
-
clearInterval(
|
|
1866
|
+
clearInterval(u);
|
|
1848
1867
|
};
|
|
1849
1868
|
}, [o]);
|
|
1850
|
-
const
|
|
1869
|
+
const we = async () => {
|
|
1851
1870
|
if (o)
|
|
1852
1871
|
try {
|
|
1853
|
-
const
|
|
1854
|
-
t.saveToken(
|
|
1855
|
-
} catch (
|
|
1856
|
-
console.error("Erro ao renovar o token:",
|
|
1872
|
+
const u = await s.refreshToken(o?.refresh_token);
|
|
1873
|
+
t.saveToken(u), a(u);
|
|
1874
|
+
} catch (u) {
|
|
1875
|
+
console.error("Erro ao renovar o token:", u), q();
|
|
1857
1876
|
}
|
|
1858
1877
|
};
|
|
1859
1878
|
return {
|
|
1860
1879
|
// Métodos básicos (compatibilidade)
|
|
1861
|
-
login:
|
|
1862
|
-
logout:
|
|
1863
|
-
username:
|
|
1864
|
-
isAuthenticated:
|
|
1865
|
-
isAuthenticating:
|
|
1866
|
-
isInitializing:
|
|
1867
|
-
isError:
|
|
1868
|
-
error:
|
|
1869
|
-
clearError:
|
|
1880
|
+
login: ee,
|
|
1881
|
+
logout: q,
|
|
1882
|
+
username: D,
|
|
1883
|
+
isAuthenticated: E,
|
|
1884
|
+
isAuthenticating: c,
|
|
1885
|
+
isInitializing: l,
|
|
1886
|
+
isError: _,
|
|
1887
|
+
error: f,
|
|
1888
|
+
clearError: L,
|
|
1870
1889
|
accessToken: o ? o.access_token : null,
|
|
1871
1890
|
// Métodos opcionais para autenticação avançada
|
|
1872
|
-
loginWithContext:
|
|
1873
|
-
loginFlexible:
|
|
1874
|
-
loginSocial:
|
|
1875
|
-
register:
|
|
1876
|
-
getSupportedContexts:
|
|
1891
|
+
loginWithContext: C.hasContextualLogin ? Y : void 0,
|
|
1892
|
+
loginFlexible: C.hasFlexibleLogin ? y : void 0,
|
|
1893
|
+
loginSocial: C.hasSocialLogin ? te : void 0,
|
|
1894
|
+
register: C.hasRegistration ? T : void 0,
|
|
1895
|
+
getSupportedContexts: ue,
|
|
1877
1896
|
validateContext: se,
|
|
1897
|
+
// MFA / segundo fator (2 passos)
|
|
1898
|
+
mfaRequired: N,
|
|
1899
|
+
verifyMfa: typeof s.verifyMfa == "function" ? ie : void 0,
|
|
1900
|
+
cancelMfa: p,
|
|
1878
1901
|
// Informações de contexto
|
|
1879
|
-
context:
|
|
1902
|
+
context: O,
|
|
1880
1903
|
// Detecção de capacidades
|
|
1881
|
-
capabilities:
|
|
1904
|
+
capabilities: C
|
|
1882
1905
|
};
|
|
1883
1906
|
}, Kr = () => {
|
|
1884
|
-
const r =
|
|
1885
|
-
(s) => s.get(
|
|
1886
|
-
), [e, t] =
|
|
1887
|
-
return
|
|
1907
|
+
const r = Ue(
|
|
1908
|
+
(s) => s.get(X.TokenManager)
|
|
1909
|
+
), [e, t] = h(null);
|
|
1910
|
+
return K(() => {
|
|
1888
1911
|
const s = r.getToken();
|
|
1889
1912
|
s && t(s.access_token);
|
|
1890
1913
|
}, []), {
|
|
1891
1914
|
token: e
|
|
1892
1915
|
};
|
|
1893
|
-
},
|
|
1894
|
-
const r =
|
|
1895
|
-
(
|
|
1896
|
-
), [e, t] =
|
|
1916
|
+
}, qr = () => {
|
|
1917
|
+
const r = Ue(
|
|
1918
|
+
(l) => l.get(X.Authenticator)
|
|
1919
|
+
), [e, t] = h(!1), [s, o] = h("");
|
|
1897
1920
|
return {
|
|
1898
|
-
sendResetPasswordEmail: async (
|
|
1921
|
+
sendResetPasswordEmail: async (l) => {
|
|
1899
1922
|
try {
|
|
1900
|
-
return await r.sendResetPasswordEmail(
|
|
1901
|
-
} catch (
|
|
1902
|
-
throw o(
|
|
1923
|
+
return await r.sendResetPasswordEmail(l);
|
|
1924
|
+
} catch (g) {
|
|
1925
|
+
throw o(oe(g)), t(!0), g;
|
|
1903
1926
|
}
|
|
1904
1927
|
},
|
|
1905
|
-
resetPassword: async (
|
|
1928
|
+
resetPassword: async (l, g, E) => {
|
|
1906
1929
|
try {
|
|
1907
|
-
return await r.resetPassword(
|
|
1908
|
-
} catch (
|
|
1909
|
-
throw o(
|
|
1930
|
+
return await r.resetPassword(l, g, E);
|
|
1931
|
+
} catch (d) {
|
|
1932
|
+
throw o(oe(d)), t(!0), d;
|
|
1910
1933
|
}
|
|
1911
1934
|
},
|
|
1912
1935
|
isError: e,
|
|
@@ -1915,165 +1938,165 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
1915
1938
|
t(!1), o("");
|
|
1916
1939
|
}
|
|
1917
1940
|
};
|
|
1918
|
-
}, Ar = () => /* @__PURE__ */ n(
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */ n(
|
|
1921
|
-
/* @__PURE__ */ n(
|
|
1941
|
+
}, Ar = () => /* @__PURE__ */ n(Yt, { p: "xl", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ P(be, { gap: "md", children: [
|
|
1942
|
+
/* @__PURE__ */ P(le, { gap: "sm", children: [
|
|
1943
|
+
/* @__PURE__ */ n(ct, { size: "sm" }),
|
|
1944
|
+
/* @__PURE__ */ n(j, { size: "sm", c: "dimmed", children: "Carregando permissões..." })
|
|
1922
1945
|
] }),
|
|
1923
|
-
/* @__PURE__ */ n(
|
|
1924
|
-
/* @__PURE__ */ n(
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */ n(
|
|
1927
|
-
/* @__PURE__ */ n(
|
|
1946
|
+
/* @__PURE__ */ n(Ie, { height: 40, radius: "sm" }),
|
|
1947
|
+
/* @__PURE__ */ n(Ie, { height: 200, radius: "sm" }),
|
|
1948
|
+
/* @__PURE__ */ P(le, { gap: "md", children: [
|
|
1949
|
+
/* @__PURE__ */ n(Ie, { height: 36, width: 100, radius: "sm" }),
|
|
1950
|
+
/* @__PURE__ */ n(Ie, { height: 36, width: 100, radius: "sm" })
|
|
1928
1951
|
] })
|
|
1929
|
-
] }) }),
|
|
1952
|
+
] }) }), Ke = je(null), Yr = ({
|
|
1930
1953
|
children: r,
|
|
1931
1954
|
user: e,
|
|
1932
1955
|
onError: t
|
|
1933
1956
|
}) => {
|
|
1934
|
-
const [s, o] =
|
|
1935
|
-
|
|
1957
|
+
const [s, o] = h(!1), [a, c] = h(null), [i] = h([]), l = e?.isAdministrator || !1, g = Se((f) => l ? !0 : i.includes(f), [i, l]), E = Se((f) => l ? !0 : f.some((S) => i.includes(S)), [i, l]), d = Se((f) => l ? !0 : f.every((S) => i.includes(S)), [i, l]), _ = Se((f) => {
|
|
1958
|
+
c(f), f && t && t(f);
|
|
1936
1959
|
}, [t]), v = {
|
|
1937
1960
|
user: e,
|
|
1938
1961
|
isLoading: s,
|
|
1939
|
-
hasGlobalPermission:
|
|
1940
|
-
hasAnyGlobalPermission:
|
|
1941
|
-
hasAllGlobalPermissions:
|
|
1942
|
-
isAdmin:
|
|
1943
|
-
error:
|
|
1944
|
-
setError:
|
|
1962
|
+
hasGlobalPermission: g,
|
|
1963
|
+
hasAnyGlobalPermission: E,
|
|
1964
|
+
hasAllGlobalPermissions: d,
|
|
1965
|
+
isAdmin: l,
|
|
1966
|
+
error: a,
|
|
1967
|
+
setError: _
|
|
1945
1968
|
};
|
|
1946
|
-
return /* @__PURE__ */ n(
|
|
1947
|
-
},
|
|
1969
|
+
return /* @__PURE__ */ n(Ke.Provider, { value: v, children: r });
|
|
1970
|
+
}, _t = je(null), Er = ({
|
|
1948
1971
|
children: r,
|
|
1949
1972
|
resourceName: e,
|
|
1950
1973
|
resourceDescription: t,
|
|
1951
1974
|
requiredPermissions: s = [],
|
|
1952
1975
|
fallbackComponent: o,
|
|
1953
|
-
loadingComponent:
|
|
1954
|
-
onSecurityReady:
|
|
1955
|
-
onError:
|
|
1976
|
+
loadingComponent: a,
|
|
1977
|
+
onSecurityReady: c,
|
|
1978
|
+
onError: i
|
|
1956
1979
|
}) => {
|
|
1957
|
-
const
|
|
1958
|
-
if (!
|
|
1980
|
+
const l = Fe(Ke);
|
|
1981
|
+
if (!l)
|
|
1959
1982
|
throw new Error("ArchbaseViewSecurityProvider deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
1960
|
-
const { user:
|
|
1961
|
-
if (
|
|
1962
|
-
if (!
|
|
1963
|
-
|
|
1983
|
+
const { user: g, isAdmin: E } = l, [d, _] = h(null), [v, f] = h(!0), [S, D] = h(null);
|
|
1984
|
+
if (ot.useEffect(() => {
|
|
1985
|
+
if (!g) {
|
|
1986
|
+
f(!1);
|
|
1964
1987
|
return;
|
|
1965
1988
|
}
|
|
1966
|
-
const
|
|
1989
|
+
const m = new gt(e, t, E);
|
|
1967
1990
|
(async () => {
|
|
1968
|
-
|
|
1991
|
+
f(!0);
|
|
1969
1992
|
try {
|
|
1970
|
-
await
|
|
1971
|
-
|
|
1993
|
+
await m.apply(() => {
|
|
1994
|
+
_(m), f(!1), c && c(m);
|
|
1972
1995
|
});
|
|
1973
1996
|
} catch {
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1997
|
+
const C = m.getError() || "Erro ao carregar permissões";
|
|
1998
|
+
D(C), f(!1), i && i(C);
|
|
1976
1999
|
}
|
|
1977
2000
|
})();
|
|
1978
|
-
}, [e, t,
|
|
1979
|
-
return
|
|
2001
|
+
}, [e, t, g, E, c, i]), v)
|
|
2002
|
+
return a ? /* @__PURE__ */ n(ne, { children: a }) : /* @__PURE__ */ n(Ar, {});
|
|
1980
2003
|
if (S)
|
|
1981
|
-
return /* @__PURE__ */ n("div", { className: "archbase-security-error", children: /* @__PURE__ */
|
|
2004
|
+
return /* @__PURE__ */ n("div", { className: "archbase-security-error", children: /* @__PURE__ */ P("div", { children: [
|
|
1982
2005
|
"Erro ao carregar permissões: ",
|
|
1983
2006
|
S
|
|
1984
2007
|
] }) });
|
|
1985
|
-
if (!
|
|
2008
|
+
if (!g)
|
|
1986
2009
|
return o || /* @__PURE__ */ n("div", { className: "archbase-security-no-user", children: /* @__PURE__ */ n("div", { children: "É necessário fazer login para acessar esta área" }) });
|
|
1987
|
-
if (s.length > 0 &&
|
|
1988
|
-
(
|
|
2010
|
+
if (s.length > 0 && d && !s.every(
|
|
2011
|
+
(R) => d.hasPermission(R)
|
|
1989
2012
|
))
|
|
1990
|
-
return o || /* @__PURE__ */
|
|
2013
|
+
return o || /* @__PURE__ */ P("div", { className: "archbase-security-access-denied", children: [
|
|
1991
2014
|
/* @__PURE__ */ n("div", { children: "Você não possui permissão para acessar esta área" }),
|
|
1992
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ P("small", { children: [
|
|
1993
2016
|
"Permissões necessárias: ",
|
|
1994
2017
|
s.join(", ")
|
|
1995
2018
|
] })
|
|
1996
2019
|
] });
|
|
1997
|
-
const
|
|
1998
|
-
securityManager:
|
|
1999
|
-
hasPermission: (
|
|
2000
|
-
hasAnyPermission: (
|
|
2001
|
-
hasAllPermissions: (
|
|
2002
|
-
registerAction: (
|
|
2003
|
-
|
|
2020
|
+
const w = {
|
|
2021
|
+
securityManager: d,
|
|
2022
|
+
hasPermission: (m) => d?.hasPermission(m) || !1,
|
|
2023
|
+
hasAnyPermission: (m) => m.some((R) => d?.hasPermission(R) || !1),
|
|
2024
|
+
hasAllPermissions: (m) => m.every((R) => d?.hasPermission(R) || !1),
|
|
2025
|
+
registerAction: (m, R) => {
|
|
2026
|
+
d?.registerAction(m, R);
|
|
2004
2027
|
},
|
|
2005
2028
|
isLoading: v,
|
|
2006
2029
|
error: S
|
|
2007
2030
|
};
|
|
2008
|
-
return /* @__PURE__ */ n(
|
|
2031
|
+
return /* @__PURE__ */ n(_t.Provider, { value: w, children: r });
|
|
2009
2032
|
}, xr = () => {
|
|
2010
|
-
const r =
|
|
2033
|
+
const r = Fe(Ke);
|
|
2011
2034
|
if (!r)
|
|
2012
2035
|
throw new Error("useArchbaseSecurity deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
2013
2036
|
return r;
|
|
2014
|
-
},
|
|
2015
|
-
const r =
|
|
2037
|
+
}, qe = () => {
|
|
2038
|
+
const r = Fe(_t);
|
|
2016
2039
|
if (!r)
|
|
2017
2040
|
throw new Error("useArchbaseViewSecurity deve ser usado dentro de um ArchbaseViewSecurityProvider");
|
|
2018
2041
|
return r;
|
|
2019
2042
|
}, Xr = (r, e) => {
|
|
2020
|
-
const t =
|
|
2021
|
-
return
|
|
2022
|
-
r && e && (
|
|
2023
|
-
}, [r, e,
|
|
2043
|
+
const t = qe(), { hasPermission: s, hasAnyPermission: o, hasAllPermissions: a, registerAction: c, securityManager: i, isLoading: l, error: g } = t;
|
|
2044
|
+
return ot.useEffect(() => {
|
|
2045
|
+
r && e && (c("create", `Criar ${e}`), c("edit", `Editar ${e}`), c("delete", `Deletar ${e}`), c("view", `Visualizar ${e}`), c("list", `Listar ${e}`));
|
|
2046
|
+
}, [r, e, c]), {
|
|
2024
2047
|
hasPermission: s,
|
|
2025
2048
|
hasAnyPermission: o,
|
|
2026
|
-
hasAllPermissions:
|
|
2027
|
-
registerAction:
|
|
2028
|
-
securityManager:
|
|
2049
|
+
hasAllPermissions: a,
|
|
2050
|
+
registerAction: c,
|
|
2051
|
+
securityManager: i,
|
|
2029
2052
|
canCreate: s("create"),
|
|
2030
2053
|
canEdit: s("edit"),
|
|
2031
2054
|
canDelete: s("delete"),
|
|
2032
2055
|
canView: s("view"),
|
|
2033
2056
|
canList: s("list"),
|
|
2034
|
-
isLoading:
|
|
2035
|
-
error:
|
|
2057
|
+
isLoading: l,
|
|
2058
|
+
error: g
|
|
2036
2059
|
};
|
|
2037
2060
|
}, Qr = () => {
|
|
2038
|
-
const r =
|
|
2061
|
+
const r = qe();
|
|
2039
2062
|
return {
|
|
2040
2063
|
check: r.hasPermission,
|
|
2041
2064
|
checkAny: r.hasAnyPermission,
|
|
2042
2065
|
checkAll: r.hasAllPermissions,
|
|
2043
2066
|
isAdmin: xr().isAdmin
|
|
2044
2067
|
};
|
|
2045
|
-
},
|
|
2068
|
+
}, Rt = ({
|
|
2046
2069
|
children: r,
|
|
2047
2070
|
actionName: e,
|
|
2048
2071
|
requiredPermissions: t = [],
|
|
2049
2072
|
requireAll: s = !0,
|
|
2050
2073
|
actionDescription: o,
|
|
2051
|
-
fallback:
|
|
2052
|
-
autoRegister:
|
|
2074
|
+
fallback: a = null,
|
|
2075
|
+
autoRegister: c = !0
|
|
2053
2076
|
}) => {
|
|
2054
|
-
const { hasPermission:
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
}, [e, o,
|
|
2058
|
-
let
|
|
2059
|
-
return e ?
|
|
2077
|
+
const { hasPermission: i, hasAnyPermission: l, hasAllPermissions: g, registerAction: E } = qe();
|
|
2078
|
+
K(() => {
|
|
2079
|
+
c && e && o && E(e, o);
|
|
2080
|
+
}, [e, o, c, E]);
|
|
2081
|
+
let d = !1;
|
|
2082
|
+
return e ? d = i(e) : t.length > 0 ? d = s ? g(t) : l(t) : d = !0, d ? /* @__PURE__ */ n(ne, { children: r }) : /* @__PURE__ */ n(ne, { children: a });
|
|
2060
2083
|
}, Zr = ({
|
|
2061
2084
|
actionName: r,
|
|
2062
2085
|
actionDescription: e,
|
|
2063
2086
|
children: t,
|
|
2064
2087
|
onClick: s,
|
|
2065
2088
|
disabled: o = !1,
|
|
2066
|
-
className:
|
|
2067
|
-
style:
|
|
2068
|
-
variant:
|
|
2069
|
-
size:
|
|
2070
|
-
type:
|
|
2089
|
+
className: a = "",
|
|
2090
|
+
style: c = {},
|
|
2091
|
+
variant: i = "primary",
|
|
2092
|
+
size: l = "medium",
|
|
2093
|
+
type: g = "button"
|
|
2071
2094
|
}) => {
|
|
2072
|
-
const
|
|
2073
|
-
const
|
|
2074
|
-
return `${
|
|
2075
|
-
},
|
|
2076
|
-
const
|
|
2095
|
+
const E = () => {
|
|
2096
|
+
const _ = "archbase-secure-btn", v = `archbase-secure-btn--${i}`, f = `archbase-secure-btn--${l}`;
|
|
2097
|
+
return `${_} ${v} ${f} ${a}`.trim();
|
|
2098
|
+
}, d = () => {
|
|
2099
|
+
const _ = {
|
|
2077
2100
|
small: { padding: "4px 8px", fontSize: "12px" },
|
|
2078
2101
|
medium: { padding: "8px 16px", fontSize: "14px" },
|
|
2079
2102
|
large: { padding: "12px 24px", fontSize: "16px" }
|
|
@@ -2090,13 +2113,13 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
2090
2113
|
cursor: o ? "not-allowed" : "pointer",
|
|
2091
2114
|
fontWeight: "500",
|
|
2092
2115
|
opacity: o ? 0.6 : 1,
|
|
2093
|
-
...
|
|
2094
|
-
...v[
|
|
2095
|
-
...
|
|
2116
|
+
..._[l],
|
|
2117
|
+
...v[i],
|
|
2118
|
+
...c
|
|
2096
2119
|
};
|
|
2097
2120
|
};
|
|
2098
2121
|
return /* @__PURE__ */ n(
|
|
2099
|
-
|
|
2122
|
+
Rt,
|
|
2100
2123
|
{
|
|
2101
2124
|
actionName: r,
|
|
2102
2125
|
actionDescription: e,
|
|
@@ -2104,11 +2127,11 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
2104
2127
|
children: /* @__PURE__ */ n(
|
|
2105
2128
|
"button",
|
|
2106
2129
|
{
|
|
2107
|
-
type:
|
|
2130
|
+
type: g,
|
|
2108
2131
|
onClick: s,
|
|
2109
2132
|
disabled: o,
|
|
2110
|
-
className:
|
|
2111
|
-
style:
|
|
2133
|
+
className: E(),
|
|
2134
|
+
style: d(),
|
|
2112
2135
|
children: t
|
|
2113
2136
|
}
|
|
2114
2137
|
)
|
|
@@ -2120,14 +2143,14 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
2120
2143
|
actionDescription: t,
|
|
2121
2144
|
showLabel: s = !0,
|
|
2122
2145
|
label: o,
|
|
2123
|
-
fallbackText:
|
|
2124
|
-
fallbackComponent:
|
|
2146
|
+
fallbackText: a = "Campo não disponível",
|
|
2147
|
+
fallbackComponent: c
|
|
2125
2148
|
}) => e ? /* @__PURE__ */ n(
|
|
2126
|
-
|
|
2149
|
+
Rt,
|
|
2127
2150
|
{
|
|
2128
2151
|
actionName: e,
|
|
2129
2152
|
actionDescription: t,
|
|
2130
|
-
fallback:
|
|
2153
|
+
fallback: c || /* @__PURE__ */ P("div", { className: "archbase-secure-field-fallback", style: {
|
|
2131
2154
|
padding: "8px",
|
|
2132
2155
|
color: "#666",
|
|
2133
2156
|
fontStyle: "italic",
|
|
@@ -2135,84 +2158,84 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
2135
2158
|
border: "1px dashed #dee2e6",
|
|
2136
2159
|
borderRadius: "4px"
|
|
2137
2160
|
}, children: [
|
|
2138
|
-
s && o && /* @__PURE__ */
|
|
2161
|
+
s && o && /* @__PURE__ */ P("label", { style: { fontWeight: "bold" }, children: [
|
|
2139
2162
|
o,
|
|
2140
2163
|
": "
|
|
2141
2164
|
] }),
|
|
2142
|
-
|
|
2165
|
+
a
|
|
2143
2166
|
] }),
|
|
2144
2167
|
children: r
|
|
2145
2168
|
}
|
|
2146
|
-
) : /* @__PURE__ */ n(
|
|
2169
|
+
) : /* @__PURE__ */ n(ne, { children: r });
|
|
2147
2170
|
function ts(r, e) {
|
|
2148
2171
|
return function(s) {
|
|
2149
|
-
const { resourceName: o, resourceDescription:
|
|
2172
|
+
const { resourceName: o, resourceDescription: a, requiredPermissions: c, fallbackComponent: i } = e;
|
|
2150
2173
|
return /* @__PURE__ */ n(
|
|
2151
2174
|
Er,
|
|
2152
2175
|
{
|
|
2153
2176
|
resourceName: o,
|
|
2154
|
-
resourceDescription:
|
|
2155
|
-
requiredPermissions:
|
|
2156
|
-
fallbackComponent:
|
|
2177
|
+
resourceDescription: a,
|
|
2178
|
+
requiredPermissions: c,
|
|
2179
|
+
fallbackComponent: i,
|
|
2157
2180
|
children: /* @__PURE__ */ n(r, { ...s })
|
|
2158
2181
|
}
|
|
2159
2182
|
);
|
|
2160
2183
|
};
|
|
2161
2184
|
}
|
|
2162
2185
|
export {
|
|
2163
|
-
|
|
2186
|
+
Dt as ARCHBASE_SECURITY_MANAGER_STORE,
|
|
2164
2187
|
yr as AccessIntervalDto,
|
|
2165
|
-
|
|
2166
|
-
|
|
2188
|
+
vt as AccessScheduleDto,
|
|
2189
|
+
Je as AccessTokenDto,
|
|
2167
2190
|
wr as ActionDto,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2191
|
+
Ge as ApiTokenDto,
|
|
2192
|
+
Tt as ArchbaseAccessTokenService,
|
|
2193
|
+
Pt as ArchbaseApiTokenService,
|
|
2194
|
+
fr as ArchbaseAuthContext,
|
|
2172
2195
|
zr as ArchbaseAuthProvider,
|
|
2173
|
-
|
|
2196
|
+
It as ArchbaseGroupService,
|
|
2174
2197
|
Vr as ArchbaseLogin,
|
|
2175
2198
|
Wr as ArchbaseMfaSetup,
|
|
2176
|
-
|
|
2177
|
-
|
|
2199
|
+
Ct as ArchbaseProfileService,
|
|
2200
|
+
Rt as ArchbaseProtectedComponent,
|
|
2178
2201
|
Hr as ArchbaseResetPassword,
|
|
2179
|
-
|
|
2202
|
+
Ut as ArchbaseResourceService,
|
|
2180
2203
|
Zr as ArchbaseSecureActionButton,
|
|
2181
2204
|
es as ArchbaseSecureFormField,
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2205
|
+
gt as ArchbaseSecurityManager,
|
|
2206
|
+
Yr as ArchbaseSecurityProvider,
|
|
2207
|
+
J as ArchbaseTenantManager,
|
|
2208
|
+
dt as ArchbaseUser,
|
|
2209
|
+
St as ArchbaseUserService,
|
|
2210
|
+
ut as ArchbaseUsernameAndPassword,
|
|
2211
|
+
ut as ArchbaseUsernameAndPasswordImpl,
|
|
2189
2212
|
Er as ArchbaseViewSecurityProvider,
|
|
2190
|
-
|
|
2213
|
+
Oe as CONTEXT_STORAGE_KEY,
|
|
2191
2214
|
Zt as DefaultArchbaseTokenManager,
|
|
2192
2215
|
Ar as DefaultSecurityLoading,
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2216
|
+
ae as ENCRYPTION_KEY,
|
|
2217
|
+
pt as FetchError,
|
|
2218
|
+
xe as GroupDto,
|
|
2196
2219
|
Fr as PermissionDto,
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2220
|
+
Ee as ProfileDto,
|
|
2221
|
+
xt as ResourceDto,
|
|
2222
|
+
ge as SecurityDto,
|
|
2223
|
+
fe as SecurityType,
|
|
2224
|
+
Me as TOKEN_COOKIE_NAME,
|
|
2202
2225
|
gr as TipoRecurso,
|
|
2203
2226
|
Be as USER_NAME,
|
|
2204
2227
|
Ne as USER_NAME_AND_PASSWORD,
|
|
2205
|
-
|
|
2206
|
-
|
|
2228
|
+
Re as UserDto,
|
|
2229
|
+
We as UserGroupDto,
|
|
2207
2230
|
dr as createInternalConfig,
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2231
|
+
Pe as decodeJWT,
|
|
2232
|
+
he as epochAtSecondsFromNow,
|
|
2233
|
+
st as epochTimeIsPast,
|
|
2211
2234
|
ir as fetchTokens,
|
|
2212
2235
|
ar as fetchWithRefreshToken,
|
|
2213
2236
|
tr as generateCodeChallenge,
|
|
2214
2237
|
er as generateRandomString,
|
|
2215
|
-
|
|
2238
|
+
ht as getRandomInteger,
|
|
2216
2239
|
pr as getRefreshExpiresIn,
|
|
2217
2240
|
sr as postWithXForm,
|
|
2218
2241
|
or as redirectToLogin,
|
|
@@ -2221,12 +2244,12 @@ export {
|
|
|
2221
2244
|
Kr as useArchbaseGetCurrentToken,
|
|
2222
2245
|
br as useArchbaseGetLoggedUser,
|
|
2223
2246
|
Qr as useArchbasePermissionCheck,
|
|
2224
|
-
|
|
2247
|
+
qr as useArchbaseResetPassword,
|
|
2225
2248
|
Xr as useArchbaseSecureForm,
|
|
2226
2249
|
xr as useArchbaseSecurity,
|
|
2227
2250
|
Gr as useArchbaseSecurityManager,
|
|
2228
2251
|
jr as useArchbaseTenantManager,
|
|
2229
|
-
|
|
2252
|
+
qe as useArchbaseViewSecurity,
|
|
2230
2253
|
$r as useBrowserStorage,
|
|
2231
2254
|
ur as validateConfig,
|
|
2232
2255
|
lr as validateState,
|