@descope/nextjs-sdk 0.15.27 → 0.15.28
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/README.md
CHANGED
|
@@ -127,6 +127,19 @@ const App = () => {
|
|
|
127
127
|
};
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
+
#### Trigger Auto Refresh
|
|
131
|
+
|
|
132
|
+
`useSession` triggers a single request to the Descope backend to attempt to refresh the session. If you **don't** `useSession` in your app, the session will not be refreshed automatically. If your app does not require `useSession`, you can trigger the refresh manually by calling `refresh` from `useDescope` hook. Example:
|
|
133
|
+
|
|
134
|
+
```js
|
|
135
|
+
import { useEffect } from 'react';
|
|
136
|
+
|
|
137
|
+
const { refresh } = useDescope();
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
refresh().catch(console.error);
|
|
140
|
+
}, [refresh]);
|
|
141
|
+
```
|
|
142
|
+
|
|
130
143
|
#### Server Side Usage
|
|
131
144
|
|
|
132
145
|
##### Require authentication for application (Middleware)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const DESCOPE_SESSION_HEADER = 'x-descope-session';
|
|
4
4
|
const baseHeaders = {
|
|
5
5
|
'x-descope-sdk-name': 'nextjs',
|
|
6
|
-
'x-descope-sdk-version': "0.15.
|
|
6
|
+
'x-descope-sdk-version': "0.15.28"
|
|
7
7
|
};
|
|
8
8
|
const DEFAULT_PUBLIC_ROUTES = {
|
|
9
9
|
signIn: process.env.SIGN_IN_ROUTE || '/sign-in',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const DESCOPE_SESSION_HEADER = 'x-descope-session';
|
|
2
2
|
const baseHeaders = {
|
|
3
3
|
'x-descope-sdk-name': 'nextjs',
|
|
4
|
-
'x-descope-sdk-version': "0.15.
|
|
4
|
+
'x-descope-sdk-version': "0.15.28"
|
|
5
5
|
};
|
|
6
6
|
const DEFAULT_PUBLIC_ROUTES = {
|
|
7
7
|
signIn: process.env.SIGN_IN_ROUTE || '/sign-in',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/nextjs-sdk",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.28",
|
|
4
4
|
"description": "Descope NextJS SDK",
|
|
5
5
|
"author": "Descope Team <info@descope.com>",
|
|
6
6
|
"homepage": "https://github.com/descope/descope-js",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@descope/node-sdk": "1.10.0",
|
|
67
|
+
"@descope/web-component": "3.60.0",
|
|
67
68
|
"@descope/core-js-sdk": "2.60.0",
|
|
68
|
-
"@descope/react-sdk": "2.27.
|
|
69
|
-
"@descope/web-component": "3.60.0"
|
|
69
|
+
"@descope/react-sdk": "2.27.10"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@babel/core": "7.26.0",
|