react-ecosistema-unp 0.6.4 → 0.7.0
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/auth/hooks/useFinalizarSesion.js +140 -4
- package/dist/chunk-IR6S3I6Y-Dvzk3EbC.js +1623 -0
- package/dist/index-CuHybtft.js +51 -0
- package/dist/lib/utils/components/ProtectedRoute.d.ts +3 -0
- package/dist/lib/utils/components/UserRoute.d.ts +3 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/shared/components/LoadingPage.js +1 -1
- package/dist/shared/components/MenuLateral.js +61 -107
- package/dist/shared/components/VentanaLienzo.js +1 -1
- package/dist/shared/components/VentanaTabs.js +1 -1
- package/dist/utils/components/ProtectedRoute.js +22 -0
- package/dist/utils/components/UserRoute.js +10 -0
- package/dist/utils.js +5 -1
- package/package.json +1 -1
- package/dist/useFinalizarSesion-COlHmXt5.js +0 -1725
|
@@ -1,6 +1,142 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import "./AuthHook.js";
|
|
3
|
-
import "../services/FinSesionService.js";
|
|
1
|
+
import { a as O } from "../../chunk-IR6S3I6Y-Dvzk3EbC.js";
|
|
2
|
+
import { useAuthId as C } from "./AuthHook.js";
|
|
3
|
+
import { FinSesionService as S } from "../services/FinSesionService.js";
|
|
4
|
+
import { isValidElement as E } from "react";
|
|
5
|
+
function L(t) {
|
|
6
|
+
if (typeof document > "u") return;
|
|
7
|
+
let o = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
|
|
8
|
+
a.type = "text/css", o.firstChild ? o.insertBefore(a, o.firstChild) : o.appendChild(a), a.styleSheet ? a.styleSheet.cssText = t : a.appendChild(document.createTextNode(t));
|
|
9
|
+
}
|
|
10
|
+
L(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
11
|
+
`);
|
|
12
|
+
var g = (t) => typeof t == "number" && !isNaN(t), c = (t) => typeof t == "string", k = (t) => typeof t == "function", U = (t) => c(t) || g(t), X = (t) => E(t) || c(t) || k(t) || g(t), D = 1, w = () => `${D++}`, i = /* @__PURE__ */ new Map(), u = [], x = /* @__PURE__ */ new Set(), I = () => i.size > 0, R = (t, { containerId: o }) => {
|
|
13
|
+
var a;
|
|
14
|
+
return (a = i.get(o || 1)) == null ? void 0 : a.toasts.get(t);
|
|
15
|
+
};
|
|
16
|
+
function N(t, o) {
|
|
17
|
+
var a;
|
|
18
|
+
if (o) return !!((a = i.get(o)) != null && a.isToastActive(t));
|
|
19
|
+
let f = !1;
|
|
20
|
+
return i.forEach((s) => {
|
|
21
|
+
s.isToastActive(t) && (f = !0);
|
|
22
|
+
}), f;
|
|
23
|
+
}
|
|
24
|
+
function F(t) {
|
|
25
|
+
if (!I()) {
|
|
26
|
+
u = u.filter((o) => t != null && o.options.toastId !== t);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (t == null || U(t)) i.forEach((o) => {
|
|
30
|
+
o.removeToast(t);
|
|
31
|
+
});
|
|
32
|
+
else if (t && ("containerId" in t || "id" in t)) {
|
|
33
|
+
let o = i.get(t.containerId);
|
|
34
|
+
o ? o.removeToast(t.id) : i.forEach((a) => {
|
|
35
|
+
a.removeToast(t.id);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
var A = (t = {}) => {
|
|
40
|
+
i.forEach((o) => {
|
|
41
|
+
o.props.limit && (!t.containerId || o.id === t.containerId) && o.clearQueue();
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
function P(t, o) {
|
|
45
|
+
X(t) && (I() || u.push({ content: t, options: o }), i.forEach((a) => {
|
|
46
|
+
a.buildToast(t, o);
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
function z(t, o) {
|
|
50
|
+
i.forEach((a) => {
|
|
51
|
+
(o == null || !(o != null && o.containerId) || (o == null ? void 0 : o.containerId) === a.id) && a.toggle(t, o == null ? void 0 : o.id);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function B(t) {
|
|
55
|
+
return x.add(t), () => {
|
|
56
|
+
x.delete(t);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function Q(t) {
|
|
60
|
+
return t && (c(t.toastId) || g(t.toastId)) ? t.toastId : w();
|
|
61
|
+
}
|
|
62
|
+
function y(t, o) {
|
|
63
|
+
return P(t, o), o.toastId;
|
|
64
|
+
}
|
|
65
|
+
function _(t, o) {
|
|
66
|
+
return { ...o, type: o && o.type || t, toastId: Q(o) };
|
|
67
|
+
}
|
|
68
|
+
function m(t) {
|
|
69
|
+
return (o, a) => y(o, _(t, a));
|
|
70
|
+
}
|
|
71
|
+
function r(t, o) {
|
|
72
|
+
return y(t, _("default", o));
|
|
73
|
+
}
|
|
74
|
+
r.loading = (t, o) => y(t, _("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...o }));
|
|
75
|
+
function M(t, { pending: o, error: a, success: f }, s) {
|
|
76
|
+
let e;
|
|
77
|
+
o && (e = c(o) ? r.loading(o, s) : r.loading(o.render, { ...s, ...o }));
|
|
78
|
+
let n = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, b = (l, d, h) => {
|
|
79
|
+
if (d == null) {
|
|
80
|
+
r.dismiss(e);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
let v = { type: l, ...n, ...s, data: h }, p = c(d) ? { render: d } : d;
|
|
84
|
+
return e ? r.update(e, { ...v, ...p }) : r(p.render, { ...v, ...p }), h;
|
|
85
|
+
}, T = k(t) ? t() : t;
|
|
86
|
+
return T.then((l) => b("success", f, l)).catch((l) => b("error", a, l)), T;
|
|
87
|
+
}
|
|
88
|
+
r.promise = M;
|
|
89
|
+
r.success = m("success");
|
|
90
|
+
r.info = m("info");
|
|
91
|
+
r.error = m("error");
|
|
92
|
+
r.warning = m("warning");
|
|
93
|
+
r.warn = r.warning;
|
|
94
|
+
r.dark = (t, o) => y(t, _("default", { theme: "dark", ...o }));
|
|
95
|
+
function V(t) {
|
|
96
|
+
F(t);
|
|
97
|
+
}
|
|
98
|
+
r.dismiss = V;
|
|
99
|
+
r.clearWaitingQueue = A;
|
|
100
|
+
r.isActive = N;
|
|
101
|
+
r.update = (t, o = {}) => {
|
|
102
|
+
let a = R(t, o);
|
|
103
|
+
if (a) {
|
|
104
|
+
let { props: f, content: s } = a, e = { delay: 100, ...f, ...o, toastId: o.toastId || t, updateId: w() };
|
|
105
|
+
e.toastId !== t && (e.staleId = t);
|
|
106
|
+
let n = e.render || s;
|
|
107
|
+
delete e.render, y(n, e);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
r.done = (t) => {
|
|
111
|
+
r.update(t, { progress: 1 });
|
|
112
|
+
};
|
|
113
|
+
r.onChange = B;
|
|
114
|
+
r.play = (t) => z(!0, t);
|
|
115
|
+
r.pause = (t) => z(!1, t);
|
|
116
|
+
const Z = () => {
|
|
117
|
+
const t = O(), { setAuthToken: o, setUserToken: a } = C();
|
|
118
|
+
return { FinSesion: () => {
|
|
119
|
+
r.promise(
|
|
120
|
+
new Promise(async (s, e) => {
|
|
121
|
+
try {
|
|
122
|
+
const n = localStorage.getItem("access_token");
|
|
123
|
+
if (!n)
|
|
124
|
+
throw new Error("No se encontró el token de acceso.");
|
|
125
|
+
await S(n), localStorage.removeItem("access_token"), localStorage.removeItem("user_token"), o(null), a(null), setTimeout(() => {
|
|
126
|
+
s(!0), t("/");
|
|
127
|
+
}, 1e3);
|
|
128
|
+
} catch (n) {
|
|
129
|
+
e(n);
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
{
|
|
133
|
+
pending: "Finalizando sesión...",
|
|
134
|
+
success: "Sesión finalizada con éxito",
|
|
135
|
+
error: "Error al finalizar la sesión"
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
} };
|
|
139
|
+
};
|
|
4
140
|
export {
|
|
5
|
-
|
|
141
|
+
Z as useFinalizarSesion
|
|
6
142
|
};
|