@logora/debate 0.4.8 → 0.4.9

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.
@@ -1,30 +1,30 @@
1
- import { jsx as l, Fragment as I } from "react/jsx-runtime";
2
- import { useState as E, useEffect as f } from "react";
1
+ import { jsx as f, Fragment as I } from "react/jsx-runtime";
2
+ import { useState as E, useEffect as l } from "react";
3
3
  import { useConfig as O } from "../../data/config_provider/useConfig.js";
4
4
  import { useDataProvider as q } from "../../data/data_provider/useDataProvider.js";
5
- import { useAuthInterceptor as S } from "../use_auth/useAuthInterceptor.js";
6
- import { authTokenHandler as T } from "../use_auth/authTokenHandler.js";
7
- import { useAuthActions as _ } from "../use_auth/useAuthActions.js";
8
- import { useAuthRequired as z } from "../../hooks/use_auth_required/useAuthRequired.js";
9
- import { useAuth as L } from "../use_auth/useAuth.js";
5
+ import { useAuthInterceptor as L } from "../use_auth/useAuthInterceptor.js";
6
+ import { authTokenHandler as S } from "../use_auth/authTokenHandler.js";
7
+ import { useAuthActions as T } from "../use_auth/useAuthActions.js";
8
+ import { useAuthRequired as _ } from "../../hooks/use_auth_required/useAuthRequired.js";
9
+ import { useAuth as z } from "../use_auth/useAuth.js";
10
10
  import { AuthProviderFactory as M } from "../providers/AuthProviderFactory.js";
11
11
  import { OnboardingModal as j } from "../../user/onboarding_modal/OnboardingModal.js";
12
12
  import { httpClient as a } from "../../data/axios_client/httpClient.js";
13
13
  const X = ({ authUrl: n, authType: i, provider: g, assertion: p }) => {
14
14
  const s = "logora_user_token", e = O(), w = q();
15
- S(a, n, s);
16
- const [v, u] = E(!1), { getToken: A, removeToken: C } = T(
15
+ L(a, n, s);
16
+ const [v, u] = E(!1), { getToken: A, removeToken: C } = S(
17
17
  a,
18
18
  n,
19
19
  s
20
- ), { loginUser: c, logoutUser: P, fetchUser: b } = _(
20
+ ), { loginUser: c, logoutUser: P, fetchUser: b } = T(
21
21
  a,
22
22
  n,
23
23
  s
24
- ), m = z(), { setIsLoggingIn: x, currentUser: k } = L();
25
- f(() => {
24
+ ), m = _(), { setIsLoggingIn: x, currentUser: k } = z();
25
+ l(() => {
26
26
  U();
27
- }, []), f(() => {
27
+ }, []), l(() => {
28
28
  if (typeof window < "u")
29
29
  return window.addEventListener("logora:authentication:require", m), () => {
30
30
  window.removeEventListener("logora:authentication:require", m);
@@ -41,7 +41,7 @@ const X = ({ authUrl: n, authType: i, provider: g, assertion: p }) => {
41
41
  if (o.shouldInitAuth()) {
42
42
  const t = o.getAuthorizationParams();
43
43
  if (t) {
44
- if (i !== "social" && i !== "oauth2_server" && e.auth?.showOnboarding === !0) {
44
+ if (i !== "social" && i !== "oauth2_server" && e.auth?.showOnboardingBeforeLogin === !0) {
45
45
  u(!0);
46
46
  return;
47
47
  }
@@ -53,7 +53,7 @@ const X = ({ authUrl: n, authType: i, provider: g, assertion: p }) => {
53
53
  const r = d().getAuthorizationParams();
54
54
  await c(r), await w.update("users", k.slug, o), u(!1);
55
55
  }, d = () => M.create(i, g, p);
56
- return /* @__PURE__ */ l(I, { children: v && /* @__PURE__ */ l(
56
+ return /* @__PURE__ */ f(I, { children: v && /* @__PURE__ */ f(
57
57
  j,
58
58
  {
59
59
  pendingAuth: !0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",