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