@sqrzro/auth 4.0.0-alpha.2 → 4.0.0-alpha.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.
@@ -1,12 +1,16 @@
1
1
 
2
- > @sqrzro/auth@4.0.0-alpha.0 dev /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
2
+ > @sqrzro/auth@4.0.0-alpha.2 dev /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
3
3
  > tsc --watch
4
4
 
5
- [8:13:28 AM] Starting compilation in watch mode...
5
+ [3:21:45 PM] Starting compilation in watch mode...
6
6
 
7
- [8:13:30 AM] Found 0 errors. Watching for file changes.
7
+ [3:21:48 PM] Found 0 errors. Watching for file changes.
8
8
 
9
- [8:13:33 AM] File change detected. Starting incremental compilation...
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...
10
14
 
11
15
  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.
12
16
  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';`
@@ -62,116 +66,90 @@
62
66
  1 import { validateSession } from '@sqrzro/server/auth';
63
67
     ~~~~~~~~~~~~~~~~~~~~~
64
68
 
65
- [8:13:33 AM] Found 9 errors. Watching for file changes.
69
+ [3:21:51 PM] Found 9 errors. Watching for file changes.
66
70
 
67
- [8:13:35 AM] File change detected. Starting incremental compilation...
71
+ [3:21:54 PM] File change detected. Starting incremental compilation...
68
72
 
69
- [8:13:36 AM] Found 0 errors. Watching for file changes.
73
+ [3:21:54 PM] Found 0 errors. Watching for file changes.
70
74
 
71
- [8:18:29 AM] File change detected. Starting incremental compilation...
75
+ [3:22:06 PM] File change detected. Starting incremental compilation...
72
76
 
73
- [8:18:29 AM] Found 0 errors. Watching for file changes.
77
+ [3:22:06 PM] Found 0 errors. Watching for file changes.
74
78
 
75
- [8:18:31 AM] File change detected. Starting incremental compilation...
79
+ [3:22:15 PM] File change detected. Starting incremental compilation...
76
80
 
77
- 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.
78
- 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';`
81
+ [3:22:15 PM] Found 0 errors. Watching for file changes.
79
82
 
80
- 3 import { deleteSession } from '@sqrzro/server/auth';
81
-    ~~~~~~~~~~~~~~~~~~~~~
83
+ [3:27:48 PM] File change detected. Starting incremental compilation...
82
84
 
83
- src/components/Password/index.tsx:1: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.
84
- 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';`
85
-
86
- 1 import { validateReset } from '@sqrzro/server/auth';
87
-    ~~~~~~~~~~~~~~~~~~~~~
85
+ [3:27:48 PM] Found 0 errors. Watching for file changes.
88
86
 
89
- src/forms/LoginForm/server.ts:3:45 - 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.
90
- 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';`
91
-
92
- 3 import { createSession, validateUser } from '@sqrzro/server/auth';
93
-    ~~~~~~~~~~~~~~~~~~~~~
94
-
95
- src/forms/LoginForm/server.ts:4:42 - error TS7016: Could not find a declaration file for module '@sqrzro/server/forms'. '/Users/richard/Sites/@sqrzro/sqrzro/packages/server/dist/forms/index.js' implicitly has an 'any' type.
96
- Try `npm i --save-dev @types/sqrzro__server` if it exists or add a new declaration (.d.ts) file containing `declare module '@sqrzro/server/forms';`
97
-
98
- 4 import { FormResponse, submitForm } from '@sqrzro/server/forms';
99
-    ~~~~~~~~~~~~~~~~~~~~~~
87
+ [3:27:49 PM] File change detected. Starting incremental compilation...
100
88
 
101
- 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.
102
- 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';`
89
+ [3:27:49 PM] Found 0 errors. Watching for file changes.
103
90
 
104
- 3 import { createReset } from '@sqrzro/server/auth';
105
-    ~~~~~~~~~~~~~~~~~~~~~
91
+ [3:27:58 PM] File change detected. Starting incremental compilation...
106
92
 
107
- src/forms/PasswordForm/server.ts:4:42 - error TS7016: Could not find a declaration file for module '@sqrzro/server/forms'. '/Users/richard/Sites/@sqrzro/sqrzro/packages/server/dist/forms/index.js' implicitly has an 'any' type.
108
- Try `npm i --save-dev @types/sqrzro__server` if it exists or add a new declaration (.d.ts) file containing `declare module '@sqrzro/server/forms';`
93
+ [3:27:58 PM] Found 0 errors. Watching for file changes.
109
94
 
110
- 4 import { FormResponse, submitForm } from '@sqrzro/server/forms';
111
-    ~~~~~~~~~~~~~~~~~~~~~~
95
+ [3:46:04 PM] File change detected. Starting incremental compilation...
112
96
 
113
- src/forms/PasswordResetForm/server.ts:3:41 - 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.
114
- 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';`
97
+ [3:46:04 PM] Found 0 errors. Watching for file changes.
115
98
 
116
- 3 import { updatePasswordWithToken } from '@sqrzro/server/auth';
117
-    ~~~~~~~~~~~~~~~~~~~~~
99
+ [3:46:05 PM] File change detected. Starting incremental compilation...
118
100
 
119
- src/forms/PasswordResetForm/server.ts:4:42 - error TS7016: Could not find a declaration file for module '@sqrzro/server/forms'. '/Users/richard/Sites/@sqrzro/sqrzro/packages/server/dist/forms/index.js' implicitly has an 'any' type.
120
- Try `npm i --save-dev @types/sqrzro__server` if it exists or add a new declaration (.d.ts) file containing `declare module '@sqrzro/server/forms';`
101
+ [3:46:05 PM] Found 0 errors. Watching for file changes.
121
102
 
122
- 4 import { FormResponse, submitForm } from '@sqrzro/server/forms';
123
-    ~~~~~~~~~~~~~~~~~~~~~~
103
+ [3:46:26 PM] File change detected. Starting incremental compilation...
124
104
 
125
- src/handle-proxy.ts:1:33 - 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.
126
- 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';`
105
+ [3:46:26 PM] Found 0 errors. Watching for file changes.
127
106
 
128
- 1 import { validateSession } from '@sqrzro/server/auth';
129
-    ~~~~~~~~~~~~~~~~~~~~~
107
+ [3:48:00 PM] File change detected. Starting incremental compilation...
130
108
 
131
- [8:18:31 AM] Found 9 errors. Watching for file changes.
109
+ [3:48:00 PM] Found 0 errors. Watching for file changes.
132
110
 
133
- [8:18:33 AM] File change detected. Starting incremental compilation...
111
+ [3:51:52 PM] File change detected. Starting incremental compilation...
134
112
 
135
- [8:18:33 AM] Found 0 errors. Watching for file changes.
113
+ [3:51:52 PM] Found 0 errors. Watching for file changes.
136
114
 
137
- [8:20:19 AM] File change detected. Starting incremental compilation...
115
+ [3:55:58 PM] File change detected. Starting incremental compilation...
138
116
 
139
- [8:20:19 AM] Found 0 errors. Watching for file changes.
117
+ [3:55:58 PM] Found 0 errors. Watching for file changes.
140
118
 
141
- [8:20:22 AM] File change detected. Starting incremental compilation...
119
+ [4:03:37 PM] File change detected. Starting incremental compilation...
142
120
 
143
- [8:20:22 AM] Found 0 errors. Watching for file changes.
121
+ [4:03:37 PM] Found 0 errors. Watching for file changes.
144
122
 
145
- [8:20:25 AM] File change detected. Starting incremental compilation...
123
+ [4:06:44 PM] File change detected. Starting incremental compilation...
146
124
 
147
- [8:20:25 AM] Found 0 errors. Watching for file changes.
125
+ [4:06:44 PM] Found 0 errors. Watching for file changes.
148
126
 
149
- [8:20:28 AM] File change detected. Starting incremental compilation...
127
+ [5:10:48 PM] File change detected. Starting incremental compilation...
150
128
 
151
- [8:20:28 AM] Found 0 errors. Watching for file changes.
129
+ [5:10:48 PM] Found 0 errors. Watching for file changes.
152
130
 
153
- [8:23:53 AM] File change detected. Starting incremental compilation...
131
+ [6:22:27 PM] File change detected. Starting incremental compilation...
154
132
 
155
- [8:23:53 AM] Found 0 errors. Watching for file changes.
133
+ [6:22:27 PM] Found 0 errors. Watching for file changes.
156
134
 
157
- [8:23:56 AM] File change detected. Starting incremental compilation...
135
+ [6:22:27 PM] File change detected. Starting incremental compilation...
158
136
 
159
- [8:23:56 AM] Found 0 errors. Watching for file changes.
137
+ [6:22:27 PM] Found 0 errors. Watching for file changes.
160
138
 
161
- [8:24:47 AM] File change detected. Starting incremental compilation...
139
+ [6:27:43 PM] File change detected. Starting incremental compilation...
162
140
 
163
- [8:24:47 AM] Found 0 errors. Watching for file changes.
141
+ [6:27:43 PM] Found 0 errors. Watching for file changes.
164
142
 
165
- [8:24:49 AM] File change detected. Starting incremental compilation...
143
+ [6:30:58 PM] File change detected. Starting incremental compilation...
166
144
 
167
- [8:24:50 AM] Found 0 errors. Watching for file changes.
145
+ [6:30:58 PM] Found 0 errors. Watching for file changes.
168
146
 
169
- [8:30:44 AM] File change detected. Starting incremental compilation...
147
+ [6:33:22 PM] File change detected. Starting incremental compilation...
170
148
 
171
- [8:30:44 AM] Found 0 errors. Watching for file changes.
149
+ [6:33:22 PM] Found 0 errors. Watching for file changes.
172
150
 
173
- [8:30:47 AM] File change detected. Starting incremental compilation...
151
+ [6:43:19 PM] File change detected. Starting incremental compilation...
174
152
 
175
- [8:30:47 AM] Found 0 errors. Watching for file changes.
153
+ [6:43:19 PM] Found 0 errors. Watching for file changes.
176
154
 
177
155
   ELIFECYCLE  Command failed.
@@ -1,6 +1,7 @@
1
1
  'use server';
2
2
  import { createSession, validateUser } from '@sqrzro/server/auth';
3
3
  import { submitForm } from '@sqrzro/server/forms';
4
+ import { log } from '@sqrzro/server/utility';
4
5
  import { redirect } from 'next/navigation';
5
6
  import { z } from 'zod';
6
7
  const schema = z
@@ -11,8 +12,11 @@ const schema = z
11
12
  })
12
13
  .required({ email: true, password: true });
13
14
  async function fn(data) {
15
+ log('auth', 'LoginForm', `Login for email ${data.email}`);
14
16
  const userID = await validateUser(data.email, data.password);
17
+ log('auth', 'LoginForm', `Validated user ${userID} for email ${data.email}`);
15
18
  await createSession(userID);
19
+ log('auth', 'LoginForm', `Session created for user ${userID}`);
16
20
  redirect('/');
17
21
  }
18
22
  async function submit(formData) {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sqrzro/auth",
3
3
  "type": "module",
4
- "version": "4.0.0-alpha.2",
4
+ "version": "4.0.0-alpha.4",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
- "@sqrzro/server": "n16",
9
8
  "zod": "^4.3.6",
9
+ "@sqrzro/server": "^4.0.0-alpha.12",
10
10
  "@sqrzro/ui": "^4.0.0-alpha.4"
11
11
  },
12
12
  "devDependencies": {
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { createSession, validateUser } from '@sqrzro/server/auth';
4
4
  import { FormResponse, submitForm } from '@sqrzro/server/forms';
5
+ import { log } from '@sqrzro/server/utility';
5
6
  import { redirect } from 'next/navigation';
6
7
  import { z } from 'zod';
7
8
 
@@ -16,9 +17,16 @@ const schema = z
16
17
  .required({ email: true, password: true });
17
18
 
18
19
  async function fn(data: LoginFormFields): Promise<void> {
20
+ log('auth', 'LoginForm', `Login for email ${data.email}`);
21
+
19
22
  const userID = await validateUser(data.email, data.password);
23
+
24
+ log('auth', 'LoginForm', `Validated user ${userID} for email ${data.email}`);
25
+
20
26
  await createSession(userID);
21
27
 
28
+ log('auth', 'LoginForm', `Session created for user ${userID}`);
29
+
22
30
  redirect('/');
23
31
  }
24
32