@authu/react 0.1.27 → 1.0.10
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 +10 -0
- package/dist/pkce.js +9 -9
- package/package.json +10 -9
package/README.md
CHANGED
|
@@ -164,6 +164,16 @@ pnpm publish --access public
|
|
|
164
164
|
|
|
165
165
|
The `--access public` flag is required for scoped packages.
|
|
166
166
|
|
|
167
|
+
## Changelog
|
|
168
|
+
|
|
169
|
+
### 1.0.10
|
|
170
|
+
|
|
171
|
+
- **Fix**: Changed PKCE storage from `sessionStorage` to `localStorage` to prevent state/code_verifier loss during cross-domain OAuth redirects
|
|
172
|
+
|
|
173
|
+
### 1.0.9
|
|
174
|
+
|
|
175
|
+
- Initial stable release
|
|
176
|
+
|
|
167
177
|
## License
|
|
168
178
|
|
|
169
179
|
MIT
|
package/dist/pkce.js
CHANGED
|
@@ -38,29 +38,29 @@ const STORAGE_KEY_VERIFIER = 'authu_code_verifier';
|
|
|
38
38
|
const STORAGE_KEY_STATE = 'authu_state';
|
|
39
39
|
const STORAGE_KEY_NONCE = 'authu_nonce';
|
|
40
40
|
export function storeCodeVerifier(verifier) {
|
|
41
|
-
|
|
41
|
+
localStorage.setItem(STORAGE_KEY_VERIFIER, verifier);
|
|
42
42
|
}
|
|
43
43
|
export function getCodeVerifier() {
|
|
44
|
-
return
|
|
44
|
+
return localStorage.getItem(STORAGE_KEY_VERIFIER);
|
|
45
45
|
}
|
|
46
46
|
export function clearCodeVerifier() {
|
|
47
|
-
|
|
47
|
+
localStorage.removeItem(STORAGE_KEY_VERIFIER);
|
|
48
48
|
}
|
|
49
49
|
export function storeState(state) {
|
|
50
|
-
|
|
50
|
+
localStorage.setItem(STORAGE_KEY_STATE, state);
|
|
51
51
|
}
|
|
52
52
|
export function getStoredState() {
|
|
53
|
-
return
|
|
53
|
+
return localStorage.getItem(STORAGE_KEY_STATE);
|
|
54
54
|
}
|
|
55
55
|
export function clearState() {
|
|
56
|
-
|
|
56
|
+
localStorage.removeItem(STORAGE_KEY_STATE);
|
|
57
57
|
}
|
|
58
58
|
export function storeNonce(nonce) {
|
|
59
|
-
|
|
59
|
+
localStorage.setItem(STORAGE_KEY_NONCE, nonce);
|
|
60
60
|
}
|
|
61
61
|
export function getStoredNonce() {
|
|
62
|
-
return
|
|
62
|
+
return localStorage.getItem(STORAGE_KEY_NONCE);
|
|
63
63
|
}
|
|
64
64
|
export function clearNonce() {
|
|
65
|
-
|
|
65
|
+
localStorage.removeItem(STORAGE_KEY_NONCE);
|
|
66
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authu/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "React SDK for AuthU - Centralized Multi-Tenant Authentication Service",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,6 +15,14 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"eslint": "eslint src --cache",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"lint": "pnpm run eslint && pnpm run typecheck",
|
|
24
|
+
"prepublishOnly": "pnpm run build"
|
|
25
|
+
},
|
|
18
26
|
"keywords": [
|
|
19
27
|
"authu",
|
|
20
28
|
"auth",
|
|
@@ -39,12 +47,5 @@
|
|
|
39
47
|
"react": "^19.0.0",
|
|
40
48
|
"typescript": "^5.7.3",
|
|
41
49
|
"typescript-eslint": "^8.44.1"
|
|
42
|
-
},
|
|
43
|
-
"scripts": {
|
|
44
|
-
"build": "tsc",
|
|
45
|
-
"dev": "tsc --watch",
|
|
46
|
-
"eslint": "eslint src --cache",
|
|
47
|
-
"typecheck": "tsc --noEmit",
|
|
48
|
-
"lint": "pnpm run eslint && pnpm run typecheck"
|
|
49
50
|
}
|
|
50
|
-
}
|
|
51
|
+
}
|