@ttoss/react-auth-strapi 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +3 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -1
- package/package.json +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -81,6 +81,7 @@ var AuthProvider = props => {
|
|
|
81
81
|
storage.clearRefreshToken();
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
+
storage.setRefreshToken(refreshData.refreshToken);
|
|
84
85
|
return {
|
|
85
86
|
user: {
|
|
86
87
|
id: data.id,
|
|
@@ -125,7 +126,7 @@ var useAuth = () => {
|
|
|
125
126
|
|
|
126
127
|
// src/Auth.tsx
|
|
127
128
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
128
|
-
var Auth =
|
|
129
|
+
var Auth = props => {
|
|
129
130
|
const {
|
|
130
131
|
setAuthData,
|
|
131
132
|
apiUrl
|
|
@@ -280,6 +281,7 @@ var Auth = () => {
|
|
|
280
281
|
});
|
|
281
282
|
}, [setScreen]);
|
|
282
283
|
return /* @__PURE__ */jsx2(AuthCore, {
|
|
284
|
+
...props,
|
|
283
285
|
screen,
|
|
284
286
|
setScreen,
|
|
285
287
|
onSignIn,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as _ttoss_react_auth_core from '@ttoss/react-auth-core';
|
|
3
|
+
import { AuthProps } from '@ttoss/react-auth-core';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
|
|
5
|
-
declare const Auth: () => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const Auth: (props: Pick<AuthProps, "logo" | "layout">) => react_jsx_runtime.JSX.Element;
|
|
6
7
|
|
|
7
8
|
declare const AuthProvider: (props: React.PropsWithChildren<{
|
|
8
9
|
apiUrl: string;
|
|
9
10
|
}>) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
declare const useAuth: () => {
|
|
11
|
-
signOut
|
|
12
|
+
signOut: () => Promise<void>;
|
|
12
13
|
isAuthenticated: boolean;
|
|
13
14
|
user: _ttoss_react_auth_core.AuthUser | null;
|
|
14
15
|
tokens: _ttoss_react_auth_core.AuthTokens | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as _ttoss_react_auth_core from '@ttoss/react-auth-core';
|
|
3
|
+
import { AuthProps } from '@ttoss/react-auth-core';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
|
|
5
|
-
declare const Auth: () => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const Auth: (props: Pick<AuthProps, "logo" | "layout">) => react_jsx_runtime.JSX.Element;
|
|
6
7
|
|
|
7
8
|
declare const AuthProvider: (props: React.PropsWithChildren<{
|
|
8
9
|
apiUrl: string;
|
|
9
10
|
}>) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
declare const useAuth: () => {
|
|
11
|
-
signOut
|
|
12
|
+
signOut: () => Promise<void>;
|
|
12
13
|
isAuthenticated: boolean;
|
|
13
14
|
user: _ttoss_react_auth_core.AuthUser | null;
|
|
14
15
|
tokens: _ttoss_react_auth_core.AuthTokens | null;
|
package/dist/index.js
CHANGED
|
@@ -125,6 +125,7 @@ var AuthProvider = props => {
|
|
|
125
125
|
storage.clearRefreshToken();
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
+
storage.setRefreshToken(refreshData.refreshToken);
|
|
128
129
|
return {
|
|
129
130
|
user: {
|
|
130
131
|
id: data.id,
|
|
@@ -169,7 +170,7 @@ var useAuth = () => {
|
|
|
169
170
|
|
|
170
171
|
// src/Auth.tsx
|
|
171
172
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
172
|
-
var Auth =
|
|
173
|
+
var Auth = props => {
|
|
173
174
|
const {
|
|
174
175
|
setAuthData,
|
|
175
176
|
apiUrl
|
|
@@ -324,6 +325,7 @@ var Auth = () => {
|
|
|
324
325
|
});
|
|
325
326
|
}, [setScreen]);
|
|
326
327
|
return /* @__PURE__ */(0, import_jsx_runtime2.jsx)(import_react_auth_core2.Auth, {
|
|
328
|
+
...props,
|
|
327
329
|
screen,
|
|
328
330
|
setScreen,
|
|
329
331
|
onSignIn,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/react-auth-strapi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Authentication components and abstractions for React apps using Strapi.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=16.8.0",
|
|
29
|
-
"@ttoss/react-auth-core": "^0.2.
|
|
30
|
-
"@ttoss/react-
|
|
31
|
-
"@ttoss/react-
|
|
29
|
+
"@ttoss/react-auth-core": "^0.2.2",
|
|
30
|
+
"@ttoss/react-i18n": "^2.0.14",
|
|
31
|
+
"@ttoss/react-notifications": "^2.4.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/react": "^19.1.8",
|
|
35
35
|
"jest": "^30.0.4",
|
|
36
36
|
"react": "^19.1.0",
|
|
37
37
|
"tsup": "^8.5.0",
|
|
38
|
+
"@ttoss/react-auth-core": "^0.2.2",
|
|
38
39
|
"@ttoss/i18n-cli": "^0.7.31",
|
|
39
40
|
"@ttoss/react-i18n": "^2.0.14",
|
|
40
|
-
"@ttoss/react-notifications": "^2.4.3"
|
|
41
|
-
"@ttoss/react-auth-core": "^0.2.0"
|
|
41
|
+
"@ttoss/react-notifications": "^2.4.3"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"React",
|