@civic/auth 0.4.9-alpha.2 → 0.5.0

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/CHANGELOG.md CHANGED
@@ -1,11 +1,8 @@
1
- # 0.4.9 Fix issue with basePath
2
- - Fix issue with basePath where it was not being correctly applied to the logout callback URL
3
- - Fix issue with basePath where it was not being correctly applied to the login callback URL
4
-
5
- # 0.4.8 NextJS fetch user fixes
1
+ # 0.5.0 NextJS fetch user fixes & basePath config support
6
2
  - when the NextJS provider loads if the user is already authenticated the user should be available immediately
7
3
  - block UI display correctly in iframe when the SDK loads in app during NextJS flow
8
4
  - use useIsClient from usehooks-ts
5
+ - add support for a basePath config where it was not being correctly applied to the logout callback URL
9
6
 
10
7
  # 0.4.7 Standalone react fixes
11
8
  - Fix case where standalone react app isn't recognising existing session
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "@civic/auth:0.4.9-alpha.2";
1
+ export declare const VERSION = "@civic/auth:0.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,8BAA8B,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,sBAAsB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // This is an auto-generated file. Do not edit.
2
- export const VERSION = "@civic/auth:0.4.9-alpha.2";
2
+ export const VERSION = "@civic/auth:0.5.0";
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// This is an auto-generated file. Do not edit.\n\nexport const VERSION = \"@civic/auth:0.4.9-alpha.2\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC","sourcesContent":["// This is an auto-generated file. Do not edit.\n\nexport const VERSION = \"@civic/auth:0.5.0\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civic/auth",
3
- "version": "0.4.9-alpha.2",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -37,21 +37,8 @@
37
37
  "require": "./dist/server/index.js"
38
38
  }
39
39
  },
40
- "scripts": {
41
- "prebuild": "pnpm generate-version",
42
- "build": "tsc -p tsconfig.build.json --noEmit false $(if [ \"$WATCH_MODE\" = \"true\" ]; then echo \"--watch\"; fi) && tsc-alias -p tsconfig.build.json",
43
- "prepublishOnly": "pnpm generate-version && node ../../etc/scripts/prompt-changelog.js && pnpm build",
44
- "dev": "if [ \"$WATCH_MODE\" = \"true\" ]; then pnpm build; else echo \"WATCH_MODE is not set to true. Skipping build.\"; fi",
45
- "pretest": "pnpm generate-version",
46
- "test": "vitest",
47
- "lint": "eslint \"src/**/*.ts*\" \"test/**/*.ts*\" --max-warnings 0",
48
- "lint:fix": "pnpm lint --fix",
49
- "test:update": "vitest --update",
50
- "generate-version": "npx tsx ./generateVersion.ts"
51
- },
52
40
  "dependencies": {
53
41
  "@emotion/react": "^11.14.0",
54
- "@civic/iframe-resizer": "workspace:*",
55
42
  "debug": "^4.3.7",
56
43
  "eventemitter3": "^5.0.1",
57
44
  "jose": "^5.9.4",
@@ -59,11 +46,10 @@
59
46
  "picomatch": "^4.0.2",
60
47
  "ts-deepmerge": "^7.0.2",
61
48
  "usehooks-ts": "^3.1.0",
62
- "uuid": "^10.0.0"
49
+ "uuid": "^10.0.0",
50
+ "@civic/iframe-resizer": "0.1.2"
63
51
  },
64
52
  "devDependencies": {
65
- "@repo/eslint-config": "workspace:*",
66
- "@repo/typescript-config": "workspace:*",
67
53
  "@rollup/plugin-typescript": "^12.1.1",
68
54
  "@testing-library/jest-dom": "^6.5.0",
69
55
  "@testing-library/react": "16.0.1",
@@ -88,7 +74,9 @@
88
74
  "tsx": "^4.19.1",
89
75
  "vite": "^5",
90
76
  "vite-plugin-dts": "^4.2.3",
91
- "vitest": "^2.1.8"
77
+ "vitest": "^2.1.8",
78
+ "@repo/eslint-config": "0.0.0",
79
+ "@repo/typescript-config": "0.0.0"
92
80
  },
93
81
  "peerDependencies": {
94
82
  "next": "^14.2.25 || >=15.2.3",
@@ -101,5 +89,16 @@
101
89
  "react": {
102
90
  "optional": false
103
91
  }
92
+ },
93
+ "scripts": {
94
+ "prebuild": "pnpm generate-version",
95
+ "build": "tsc -p tsconfig.build.json --noEmit false $(if [ \"$WATCH_MODE\" = \"true\" ]; then echo \"--watch\"; fi) && tsc-alias -p tsconfig.build.json",
96
+ "dev": "if [ \"$WATCH_MODE\" = \"true\" ]; then pnpm build; else echo \"WATCH_MODE is not set to true. Skipping build.\"; fi",
97
+ "pretest": "pnpm generate-version",
98
+ "test": "vitest",
99
+ "lint": "eslint \"src/**/*.ts*\" \"test/**/*.ts*\" --max-warnings 0",
100
+ "lint:fix": "pnpm lint --fix",
101
+ "test:update": "vitest --update",
102
+ "generate-version": "npx tsx ./generateVersion.ts"
104
103
  }
105
- }
104
+ }
@@ -1,7 +0,0 @@
1
- declare const getWindowCookieValue: (requests: {
2
- key: string;
3
- window: Window;
4
- parseJson?: boolean;
5
- }[]) => Record<string, string | Record<string, unknown>> | null;
6
- export { getWindowCookieValue };
7
- //# sourceMappingURL=cookies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/lib/cookies.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,oBAAoB,aACd;IACR,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,EAAE,4DAqBJ,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -1,26 +0,0 @@
1
- // TODO REMOVE IN FAVOUR OF BrowserCookieStorage.get
2
- const getWindowCookieValue = (requests) => {
3
- const cookie = window.document.cookie;
4
- if (!cookie)
5
- return null;
6
- const cookies = cookie.split(";");
7
- const response = {};
8
- for (const c of cookies) {
9
- const [name, value] = c.trim().split("=");
10
- const request = requests.find((r) => r.key === name);
11
- if (value && request) {
12
- try {
13
- const decodeURIComponentValue = decodeURIComponent(value);
14
- response[request.key] = request.parseJson
15
- ? JSON.parse(decodeURIComponentValue)
16
- : decodeURIComponentValue;
17
- }
18
- catch {
19
- response[request.key] = value;
20
- }
21
- }
22
- }
23
- return response;
24
- };
25
- export { getWindowCookieValue };
26
- //# sourceMappingURL=cookies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../src/lib/cookies.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,oBAAoB,GAAG,CAC3B,QAIG,EACH,EAAE;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IACtC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,QAAQ,GAAqD,EAAE,CAAC;IACtE,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;QACrD,IAAI,KAAK,IAAI,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC;gBACH,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;gBAC1D,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,SAAS;oBACvC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC;oBACrC,CAAC,CAAC,uBAAuB,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACP,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAChC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC","sourcesContent":["// TODO REMOVE IN FAVOUR OF BrowserCookieStorage.get\nconst getWindowCookieValue = (\n requests: {\n key: string;\n window: Window;\n parseJson?: boolean;\n }[],\n) => {\n const cookie = window.document.cookie;\n if (!cookie) return null;\n const cookies = cookie.split(\";\");\n const response: Record<string, string | Record<string, unknown>> = {};\n for (const c of cookies) {\n const [name, value] = c.trim().split(\"=\");\n const request = requests.find((r) => r.key === name);\n if (value && request) {\n try {\n const decodeURIComponentValue = decodeURIComponent(value);\n response[request.key] = request.parseJson\n ? JSON.parse(decodeURIComponentValue)\n : decodeURIComponentValue;\n } catch {\n response[request.key] = value;\n }\n }\n }\n return response;\n};\n\nexport { getWindowCookieValue };\n"]}