@sqrzro/auth 4.0.0-alpha.4 → 4.0.0-alpha.6

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @sqrzro/auth@4.0.0-alpha.1 build /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
3
+ > @sqrzro/auth@4.0.0-alpha.5 build /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
4
4
  > tsc
5
5
 
@@ -1,16 +1,12 @@
1
1
 
2
- > @sqrzro/auth@4.0.0-alpha.2 dev /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
2
+ > @sqrzro/auth@4.0.0-alpha.5 dev /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
3
3
  > tsc --watch
4
4
 
5
- [3:21:45 PM] Starting compilation in watch mode...
5
+ [2:01:09 PM] Starting compilation in watch mode...
6
6
 
7
- [3:21:48 PM] Found 0 errors. Watching for file changes.
7
+ [2:01:11 PM] Found 0 errors. Watching for file changes.
8
8
 
9
- [3:21:50 PM] File change detected. Starting incremental compilation...
10
-
11
- [3:21:50 PM] Found 0 errors. Watching for file changes.
12
-
13
- [3:21:51 PM] File change detected. Starting incremental compilation...
9
+ [2:01:13 PM] File change detected. Starting incremental compilation...
14
10
 
15
11
  src/components/LogoutButton/server.ts:3:31 - error TS7016: Could not find a declaration file for module '@sqrzro/server/auth'. '/Users/richard/Sites/@sqrzro/sqrzro/packages/server/dist/auth/index.js' implicitly has an 'any' type.
16
12
  Try `npm i --save-dev @types/sqrzro__server` if it exists or add a new declaration (.d.ts) file containing `declare module '@sqrzro/server/auth';`
@@ -36,6 +32,12 @@
36
32
  4 import { FormResponse, submitForm } from '@sqrzro/server/forms';
37
33
     ~~~~~~~~~~~~~~~~~~~~~~
38
34
 
35
+ src/forms/LoginForm/server.ts:5:21 - error TS7016: Could not find a declaration file for module '@sqrzro/server/utility'. '/Users/richard/Sites/@sqrzro/sqrzro/packages/server/dist/utility/index.js' implicitly has an 'any' type.
36
+ Try `npm i --save-dev @types/sqrzro__server` if it exists or add a new declaration (.d.ts) file containing `declare module '@sqrzro/server/utility';`
37
+
38
+ 5 import { log } from '@sqrzro/server/utility';
39
+    ~~~~~~~~~~~~~~~~~~~~~~~~
40
+
39
41
  src/forms/PasswordForm/server.ts:3:29 - error TS7016: Could not find a declaration file for module '@sqrzro/server/auth'. '/Users/richard/Sites/@sqrzro/sqrzro/packages/server/dist/auth/index.js' implicitly has an 'any' type.
40
42
  Try `npm i --save-dev @types/sqrzro__server` if it exists or add a new declaration (.d.ts) file containing `declare module '@sqrzro/server/auth';`
41
43
 
@@ -66,90 +68,26 @@
66
68
  1 import { validateSession } from '@sqrzro/server/auth';
67
69
     ~~~~~~~~~~~~~~~~~~~~~
68
70
 
69
- [3:21:51 PM] Found 9 errors. Watching for file changes.
70
-
71
- [3:21:54 PM] File change detected. Starting incremental compilation...
72
-
73
- [3:21:54 PM] Found 0 errors. Watching for file changes.
74
-
75
- [3:22:06 PM] File change detected. Starting incremental compilation...
76
-
77
- [3:22:06 PM] Found 0 errors. Watching for file changes.
78
-
79
- [3:22:15 PM] File change detected. Starting incremental compilation...
80
-
81
- [3:22:15 PM] Found 0 errors. Watching for file changes.
82
-
83
- [3:27:48 PM] File change detected. Starting incremental compilation...
84
-
85
- [3:27:48 PM] Found 0 errors. Watching for file changes.
86
-
87
- [3:27:49 PM] File change detected. Starting incremental compilation...
88
-
89
- [3:27:49 PM] Found 0 errors. Watching for file changes.
90
-
91
- [3:27:58 PM] File change detected. Starting incremental compilation...
92
-
93
- [3:27:58 PM] Found 0 errors. Watching for file changes.
94
-
95
- [3:46:04 PM] File change detected. Starting incremental compilation...
96
-
97
- [3:46:04 PM] Found 0 errors. Watching for file changes.
98
-
99
- [3:46:05 PM] File change detected. Starting incremental compilation...
100
-
101
- [3:46:05 PM] Found 0 errors. Watching for file changes.
102
-
103
- [3:46:26 PM] File change detected. Starting incremental compilation...
104
-
105
- [3:46:26 PM] Found 0 errors. Watching for file changes.
106
-
107
- [3:48:00 PM] File change detected. Starting incremental compilation...
108
-
109
- [3:48:00 PM] Found 0 errors. Watching for file changes.
110
-
111
- [3:51:52 PM] File change detected. Starting incremental compilation...
112
-
113
- [3:51:52 PM] Found 0 errors. Watching for file changes.
114
-
115
- [3:55:58 PM] File change detected. Starting incremental compilation...
116
-
117
- [3:55:58 PM] Found 0 errors. Watching for file changes.
118
-
119
- [4:03:37 PM] File change detected. Starting incremental compilation...
120
-
121
- [4:03:37 PM] Found 0 errors. Watching for file changes.
122
-
123
- [4:06:44 PM] File change detected. Starting incremental compilation...
124
-
125
- [4:06:44 PM] Found 0 errors. Watching for file changes.
126
-
127
- [5:10:48 PM] File change detected. Starting incremental compilation...
128
-
129
- [5:10:48 PM] Found 0 errors. Watching for file changes.
130
-
131
- [6:22:27 PM] File change detected. Starting incremental compilation...
132
-
133
- [6:22:27 PM] Found 0 errors. Watching for file changes.
71
+ [2:01:13 PM] Found 10 errors. Watching for file changes.
134
72
 
135
- [6:22:27 PM] File change detected. Starting incremental compilation...
73
+ [2:01:16 PM] File change detected. Starting incremental compilation...
136
74
 
137
- [6:22:27 PM] Found 0 errors. Watching for file changes.
75
+ [2:01:16 PM] Found 0 errors. Watching for file changes.
138
76
 
139
- [6:27:43 PM] File change detected. Starting incremental compilation...
77
+ [2:13:49 PM] File change detected. Starting incremental compilation...
140
78
 
141
- [6:27:43 PM] Found 0 errors. Watching for file changes.
79
+ [2:13:50 PM] Found 0 errors. Watching for file changes.
142
80
 
143
- [6:30:58 PM] File change detected. Starting incremental compilation...
81
+ [2:13:50 PM] File change detected. Starting incremental compilation...
144
82
 
145
- [6:30:58 PM] Found 0 errors. Watching for file changes.
83
+ [2:13:50 PM] Found 0 errors. Watching for file changes.
146
84
 
147
- [6:33:22 PM] File change detected. Starting incremental compilation...
85
+ [2:21:47 PM] File change detected. Starting incremental compilation...
148
86
 
149
- [6:33:22 PM] Found 0 errors. Watching for file changes.
87
+ [2:21:47 PM] Found 0 errors. Watching for file changes.
150
88
 
151
- [6:43:19 PM] File change detected. Starting incremental compilation...
89
+ [2:21:49 PM] File change detected. Starting incremental compilation...
152
90
 
153
- [6:43:19 PM] Found 0 errors. Watching for file changes.
91
+ [2:21:49 PM] Found 0 errors. Watching for file changes.
154
92
 
155
93
   ELIFECYCLE  Command failed.
@@ -1,6 +1,3 @@
1
- interface AuthProps {
2
- params: Promise<Record<string, string>>;
3
- searchParams: Promise<Record<string, string>>;
4
- }
5
- declare function Auth({ params, searchParams }: Readonly<AuthProps>): React.ReactElement;
1
+ import type { NextPageProps } from '@sqrzro/ui/utility';
2
+ declare function Auth(props: NextPageProps): React.ReactElement;
6
3
  export default Auth;
@@ -3,9 +3,9 @@ import { Suspense } from 'react';
3
3
  import { notFound } from 'next/navigation';
4
4
  import LoginForm from '../../forms/LoginForm';
5
5
  import Password from '../Password';
6
- async function AuthComponent({ params, searchParams, }) {
6
+ async function AuthComponent({ params, searchParams }) {
7
7
  const awaitedParams = await params;
8
- if (!Array.isArray(awaitedParams.auth) || awaitedParams.auth.length !== 1) {
8
+ if (!awaitedParams || !Array.isArray(awaitedParams.auth) || awaitedParams.auth.length !== 1) {
9
9
  return notFound();
10
10
  }
11
11
  if (awaitedParams.auth[0] === 'login') {
@@ -19,7 +19,7 @@ async function AuthComponent({ params, searchParams, }) {
19
19
  }
20
20
  return notFound();
21
21
  }
22
- function Auth({ params, searchParams }) {
23
- return (_jsxs("div", { children: ["AUTH PAGE HEADER", _jsx(Suspense, { children: _jsx(AuthComponent, { params: params, searchParams: searchParams }) })] }));
22
+ function Auth(props) {
23
+ return (_jsxs("div", { children: ["AUTH PAGE HEADER", _jsx(Suspense, { children: _jsx(AuthComponent, { ...props }) })] }));
24
24
  }
25
25
  export default Auth;
@@ -1,5 +1,5 @@
1
1
  interface PasswordProps {
2
- searchParams: Promise<Record<string, string>>;
2
+ searchParams?: Promise<Record<string, string>> | null;
3
3
  }
4
4
  declare function Password({ searchParams }: Readonly<PasswordProps>): Promise<React.ReactElement>;
5
5
  export default Password;
@@ -4,7 +4,7 @@ import PasswordForm from '../../forms/PasswordForm';
4
4
  import PasswordResetForm from '../../forms/PasswordResetForm';
5
5
  async function Password({ searchParams }) {
6
6
  const awaitedSearchParams = await searchParams;
7
- if (awaitedSearchParams.token) {
7
+ if (awaitedSearchParams?.token) {
8
8
  const validated = await validateReset('PASSWORD', awaitedSearchParams.token);
9
9
  if (validated) {
10
10
  return _jsx(PasswordResetForm, { token: awaitedSearchParams.token });
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sqrzro/auth",
3
3
  "type": "module",
4
- "version": "4.0.0-alpha.4",
4
+ "version": "4.0.0-alpha.6",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
8
  "zod": "^4.3.6",
9
- "@sqrzro/server": "^4.0.0-alpha.12",
10
- "@sqrzro/ui": "^4.0.0-alpha.4"
9
+ "@sqrzro/server": "^4.0.0-alpha.15",
10
+ "@sqrzro/ui": "^4.0.0-alpha.13"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/react": "^19.2.7",
@@ -1,22 +1,16 @@
1
1
  import { Suspense } from 'react';
2
2
 
3
+ import type { NextPageProps } from '@sqrzro/ui/utility';
3
4
  import { notFound } from 'next/navigation';
4
5
 
5
6
  import LoginForm from '../../forms/LoginForm';
6
- import Password from '../Password';
7
7
 
8
- interface AuthProps {
9
- params: Promise<Record<string, string>>;
10
- searchParams: Promise<Record<string, string>>;
11
- }
8
+ import Password from '../Password';
12
9
 
13
- async function AuthComponent({
14
- params,
15
- searchParams,
16
- }: Readonly<AuthProps>): Promise<React.ReactElement> {
10
+ async function AuthComponent({ params, searchParams }: NextPageProps): Promise<React.ReactElement> {
17
11
  const awaitedParams = await params;
18
12
 
19
- if (!Array.isArray(awaitedParams.auth) || awaitedParams.auth.length !== 1) {
13
+ if (!awaitedParams || !Array.isArray(awaitedParams.auth) || awaitedParams.auth.length !== 1) {
20
14
  return notFound();
21
15
  }
22
16
 
@@ -35,12 +29,12 @@ async function AuthComponent({
35
29
  return notFound();
36
30
  }
37
31
 
38
- function Auth({ params, searchParams }: Readonly<AuthProps>): React.ReactElement {
32
+ function Auth(props: NextPageProps): React.ReactElement {
39
33
  return (
40
34
  <div>
41
35
  AUTH PAGE HEADER
42
36
  <Suspense>
43
- <AuthComponent params={params} searchParams={searchParams} />
37
+ <AuthComponent {...props} />
44
38
  </Suspense>
45
39
  </div>
46
40
  );
@@ -4,13 +4,13 @@ import PasswordForm from '../../forms/PasswordForm';
4
4
  import PasswordResetForm from '../../forms/PasswordResetForm';
5
5
 
6
6
  interface PasswordProps {
7
- searchParams: Promise<Record<string, string>>;
7
+ searchParams?: Promise<Record<string, string>> | null;
8
8
  }
9
9
 
10
10
  async function Password({ searchParams }: Readonly<PasswordProps>): Promise<React.ReactElement> {
11
11
  const awaitedSearchParams = await searchParams;
12
12
 
13
- if (awaitedSearchParams.token) {
13
+ if (awaitedSearchParams?.token) {
14
14
  const validated = await validateReset('PASSWORD', awaitedSearchParams.token);
15
15
 
16
16
  if (validated) {