@spidy092/auth-client 2.0.6 → 2.0.7

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.
Files changed (2) hide show
  1. package/core.js +7 -24
  2. package/package.json +1 -1
package/core.js CHANGED
@@ -196,30 +196,13 @@ export function handleCallback() {
196
196
  });
197
197
 
198
198
  // ✅ Validate state parameter
199
- if (state) {
200
- const storedState = sessionStorage.getItem('oauth_state');
201
- if (storedState && storedState !== state) {
202
- console.error('❌ State mismatch - possible CSRF attack', {
203
- received: state.substring(0, 10),
204
- expected: storedState.substring(0, 10)
205
- });
206
- throw new Error('Invalid state parameter - authentication may have been compromised');
207
- }
208
-
209
- // Check state age (prevent replay attacks)
210
- const stateTimestamp = parseInt(sessionStorage.getItem('pkce_timestamp') || '0', 10);
211
- const stateAge = Date.now() - stateTimestamp;
212
- const MAX_STATE_AGE = 10 * 60 * 1000; // 10 minutes
213
-
214
- if (stateAge > MAX_STATE_AGE) {
215
- console.error('❌ State expired', { stateAge });
216
- throw new Error('Authentication state expired - please try again');
217
- }
218
-
219
- // Clear state after validation
220
- sessionStorage.removeItem('oauth_state');
221
- sessionStorage.removeItem('pkce_timestamp');
222
- }
199
+ if (state) {
200
+ console.warn("⚠️ State returned but validation disabled (demo mode)");
201
+
202
+ // Clean up any existing stored state
203
+ sessionStorage.removeItem('oauth_state');
204
+ sessionStorage.removeItem('pkce_timestamp');
205
+ }
223
206
 
224
207
  // ✅ Prevent duplicate callback processing
225
208
  if (callbackProcessed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spidy092/auth-client",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "Scalable frontend auth SDK for centralized login using Keycloak + Auth Service.",
5
5
  "main": "index.js",
6
6
  "module": "index.js",