docpouch-client 1.1.3 → 1.1.4

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/index.js CHANGED
@@ -626,8 +626,13 @@ export default class docPouchClient {
626
626
  return false;
627
627
  }
628
628
  // Check URL query parameters for logout confirmation
629
- const urlParams = new URLSearchParams(window.location.search);
630
- const logoutParam = urlParams.get('logout');
629
+ // Also check hash parameters for hash-mode routing compatibility
630
+ const searchParams = new URLSearchParams(window.location.search);
631
+ const hashQuery = window.location.hash.includes('?')
632
+ ? window.location.hash.split('?')[1]
633
+ : window.location.hash.replace(/^#\/?/, '');
634
+ const hashParams = new URLSearchParams(hashQuery);
635
+ const logoutParam = searchParams.get('logout') || hashParams.get('logout');
631
636
  // If logout parameter is explicitly 'no', user cancelled
632
637
  if (logoutParam === 'no') {
633
638
  // Clear the logout in progress flag
@@ -656,7 +661,7 @@ export default class docPouchClient {
656
661
  if (logoutParam === null) {
657
662
  // Check if this is a post-logout redirect - assume logout was successful
658
663
  // unless there's an error parameter
659
- const errorParam = urlParams.get('error');
664
+ const errorParam = searchParams.get('error') || hashParams.get('error');
660
665
  if (!errorParam) {
661
666
  // Clear the logout in progress flag
662
667
  if (typeof window !== 'undefined' && window.sessionStorage) {
package/package.json CHANGED
@@ -1,41 +1,41 @@
1
- {
2
- "name": "docpouch-client",
3
- "version": "1.1.3",
4
- "main": "dist/index.js",
5
- "types": "dist/index.d.ts",
6
- "exports": {
7
- ".": {
8
- "import": "./dist/index.js",
9
- "require": "./dist/index.js"
10
- }
11
- },
12
- "type": "module",
13
- "scripts": {
14
- "build": "tsc -p tsconfig.build.json",
15
- "test": "node --experimental-vm-modules --no-warnings ./node_modules/jest/bin/jest.js --forceExit --silent"
16
- },
17
- "keywords": [
18
- "docPouch",
19
- "API"
20
- ],
21
- "author": "Jan Frecè",
22
- "license": "MIT",
23
- "description": "Client SDK for DocPouch API - supports JWT and OIDC authentication",
24
- "repository": {
25
- "type": "git",
26
- "url": "git+https://github.com/BFH-JTF/docpouch-client.git"
27
- },
28
- "devDependencies": {
29
- "@types/express": "^5.0.6",
30
- "@types/jest": "^30.0.0",
31
- "@types/node": "^25.9.1",
32
- "express": "^5.2.1",
33
- "jest": "^30.4.2",
34
- "socket.io": "^4.8.3",
35
- "ts-jest": "^29.4.10",
36
- "typescript": "^6.0.3"
37
- },
38
- "dependencies": {
39
- "socket.io-client": "^4.8.3"
40
- }
41
- }
1
+ {
2
+ "name": "docpouch-client",
3
+ "version": "1.1.4",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.js"
10
+ }
11
+ },
12
+ "type": "module",
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.build.json",
15
+ "test": "node --experimental-vm-modules --no-warnings ./node_modules/jest/bin/jest.js --forceExit --silent"
16
+ },
17
+ "keywords": [
18
+ "docPouch",
19
+ "API"
20
+ ],
21
+ "author": "Jan Frecè",
22
+ "license": "MIT",
23
+ "description": "Client SDK for DocPouch API - supports JWT and OIDC authentication",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/BFH-JTF/docpouch-client.git"
27
+ },
28
+ "devDependencies": {
29
+ "@types/express": "^5.0.6",
30
+ "@types/jest": "^30.0.0",
31
+ "@types/node": "^25.9.1",
32
+ "express": "^5.2.1",
33
+ "jest": "^30.4.2",
34
+ "socket.io": "^4.8.3",
35
+ "ts-jest": "^29.4.10",
36
+ "typescript": "^6.0.3"
37
+ },
38
+ "dependencies": {
39
+ "socket.io-client": "^4.8.3"
40
+ }
41
+ }
@@ -1,24 +0,0 @@
1
- // Test script to verify post_logout_redirect_uris functionality
2
- const fs = require('fs');
3
-
4
- // Read the built client to verify the changes
5
- const clientCode = fs.readFileSync('dist/index.js', 'utf8');
6
-
7
- console.log('Checking for post_logout_redirect_uris support...');
8
-
9
- // Check if the interfaces include post_logout_redirect_uris
10
- const hasRegistrationInterface = clientCode.includes('post_logout_redirect_uris?: string[]');
11
- const hasResponseInterface = clientCode.includes('post_logout_redirect_uris?: string[]');
12
-
13
- // Check if logout methods use postLogoutRedirectUri
14
- const usesPostLogoutUri = clientCode.includes('this.oidcConfig.postLogoutRedirectUri');
15
-
16
- console.log('I_OidcClientRegistration has post_logout_redirect_uris:', hasRegistrationInterface);
17
- console.log('I_OidcClientResponse has post_logout_redirect_uris:', hasResponseInterface);
18
- console.log('Logout methods use postLogoutRedirectUri:', usesPostLogoutUri);
19
-
20
- if (hasRegistrationInterface && hasResponseInterface && usesPostLogoutUri) {
21
- console.log('✅ All post_logout_redirect_uris functionality is properly implemented!');
22
- } else {
23
- console.log('❌ Some post_logout_redirect_uris functionality is missing');
24
- }