@sqrzro/auth 4.0.0-alpha.1 → 4.0.0-alpha.3
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/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-dev.log
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
> @sqrzro/auth@4.0.0-alpha.
|
|
2
|
+
> @sqrzro/auth@4.0.0-alpha.2 dev /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
|
|
3
3
|
> tsc --watch
|
|
4
4
|
|
|
5
|
-
[2J[3J[H[[
|
|
5
|
+
[2J[3J[H[[90m3:21:45 PM[0m] Starting compilation in watch mode...
|
|
6
6
|
|
|
7
|
-
[[
|
|
7
|
+
[[90m3:21:48 PM[0m] Found 0 errors. Watching for file changes.
|
|
8
8
|
|
|
9
|
-
[2J[3J[H[[
|
|
9
|
+
[2J[3J[H[[90m3:21:50 PM[0m] File change detected. Starting incremental compilation...
|
|
10
|
+
|
|
11
|
+
[[90m3:21:50 PM[0m] Found 0 errors. Watching for file changes.
|
|
12
|
+
|
|
13
|
+
[2J[3J[H[[90m3:21:51 PM[0m] File change detected. Starting incremental compilation...
|
|
10
14
|
|
|
11
15
|
[96msrc/components/LogoutButton/server.ts[0m:[93m3[0m:[93m31[0m - [91merror[0m[90m TS7016: [0mCould 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
|
[7m1[0m import { validateSession } from '@sqrzro/server/auth';
|
|
63
67
|
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
|
|
64
68
|
|
|
65
|
-
[[
|
|
69
|
+
[[90m3:21:51 PM[0m] Found 9 errors. Watching for file changes.
|
|
66
70
|
|
|
67
|
-
[2J[3J[H[[
|
|
71
|
+
[2J[3J[H[[90m3:21:54 PM[0m] File change detected. Starting incremental compilation...
|
|
68
72
|
|
|
69
|
-
[[
|
|
73
|
+
[[90m3:21:54 PM[0m] Found 0 errors. Watching for file changes.
|
|
70
74
|
|
|
71
|
-
[2J[3J[H[[
|
|
75
|
+
[2J[3J[H[[90m3:22:06 PM[0m] File change detected. Starting incremental compilation...
|
|
72
76
|
|
|
73
|
-
[[
|
|
77
|
+
[[90m3:22:06 PM[0m] Found 0 errors. Watching for file changes.
|
|
74
78
|
|
|
75
|
-
[2J[3J[H[[
|
|
79
|
+
[2J[3J[H[[90m3:22:15 PM[0m] File change detected. Starting incremental compilation...
|
|
76
80
|
|
|
77
|
-
|
|
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
|
+
[[90m3:22:15 PM[0m] Found 0 errors. Watching for file changes.
|
|
79
82
|
|
|
80
|
-
[
|
|
81
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
|
|
83
|
+
[2J[3J[H[[90m3:27:48 PM[0m] File change detected. Starting incremental compilation...
|
|
82
84
|
|
|
83
|
-
|
|
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
|
-
[7m1[0m import { validateReset } from '@sqrzro/server/auth';
|
|
87
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
|
|
85
|
+
[[90m3:27:48 PM[0m] Found 0 errors. Watching for file changes.
|
|
88
86
|
|
|
89
|
-
[
|
|
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
|
-
[7m3[0m import { createSession, validateUser } from '@sqrzro/server/auth';
|
|
93
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
|
|
94
|
-
|
|
95
|
-
[96msrc/forms/LoginForm/server.ts[0m:[93m4[0m:[93m42[0m - [91merror[0m[90m TS7016: [0mCould 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
|
-
[7m4[0m import { FormResponse, submitForm } from '@sqrzro/server/forms';
|
|
99
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
87
|
+
[2J[3J[H[[90m3:27:49 PM[0m] File change detected. Starting incremental compilation...
|
|
100
88
|
|
|
101
|
-
|
|
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
|
+
[[90m3:27:49 PM[0m] Found 0 errors. Watching for file changes.
|
|
103
90
|
|
|
104
|
-
[
|
|
105
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
|
|
91
|
+
[2J[3J[H[[90m3:27:58 PM[0m] File change detected. Starting incremental compilation...
|
|
106
92
|
|
|
107
|
-
|
|
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
|
+
[[90m3:27:58 PM[0m] Found 0 errors. Watching for file changes.
|
|
109
94
|
|
|
110
|
-
[
|
|
111
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
95
|
+
[2J[3J[H[[90m3:46:04 PM[0m] File change detected. Starting incremental compilation...
|
|
112
96
|
|
|
113
|
-
|
|
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
|
+
[[90m3:46:04 PM[0m] Found 0 errors. Watching for file changes.
|
|
115
98
|
|
|
116
|
-
[
|
|
117
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
|
|
99
|
+
[2J[3J[H[[90m3:46:05 PM[0m] File change detected. Starting incremental compilation...
|
|
118
100
|
|
|
119
|
-
|
|
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
|
+
[[90m3:46:05 PM[0m] Found 0 errors. Watching for file changes.
|
|
121
102
|
|
|
122
|
-
[
|
|
123
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~~[0m
|
|
103
|
+
[2J[3J[H[[90m3:46:26 PM[0m] File change detected. Starting incremental compilation...
|
|
124
104
|
|
|
125
|
-
|
|
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
|
+
[[90m3:46:26 PM[0m] Found 0 errors. Watching for file changes.
|
|
127
106
|
|
|
128
|
-
[
|
|
129
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~~~[0m
|
|
107
|
+
[2J[3J[H[[90m3:48:00 PM[0m] File change detected. Starting incremental compilation...
|
|
130
108
|
|
|
131
|
-
[[
|
|
109
|
+
[[90m3:48:00 PM[0m] Found 0 errors. Watching for file changes.
|
|
132
110
|
|
|
133
|
-
[2J[3J[H[[
|
|
111
|
+
[2J[3J[H[[90m3:51:52 PM[0m] File change detected. Starting incremental compilation...
|
|
134
112
|
|
|
135
|
-
[[
|
|
113
|
+
[[90m3:51:52 PM[0m] Found 0 errors. Watching for file changes.
|
|
136
114
|
|
|
137
|
-
[2J[3J[H[[
|
|
115
|
+
[2J[3J[H[[90m3:55:58 PM[0m] File change detected. Starting incremental compilation...
|
|
138
116
|
|
|
139
|
-
[[
|
|
117
|
+
[[90m3:55:58 PM[0m] Found 0 errors. Watching for file changes.
|
|
140
118
|
|
|
141
|
-
[2J[3J[H[[
|
|
119
|
+
[2J[3J[H[[90m4:03:37 PM[0m] File change detected. Starting incremental compilation...
|
|
142
120
|
|
|
143
|
-
[[
|
|
121
|
+
[[90m4:03:37 PM[0m] Found 0 errors. Watching for file changes.
|
|
144
122
|
|
|
145
|
-
[2J[3J[H[[
|
|
123
|
+
[2J[3J[H[[90m4:06:44 PM[0m] File change detected. Starting incremental compilation...
|
|
146
124
|
|
|
147
|
-
[[
|
|
125
|
+
[[90m4:06:44 PM[0m] Found 0 errors. Watching for file changes.
|
|
148
126
|
|
|
149
|
-
[2J[3J[H[[
|
|
127
|
+
[2J[3J[H[[90m5:10:48 PM[0m] File change detected. Starting incremental compilation...
|
|
150
128
|
|
|
151
|
-
[[
|
|
129
|
+
[[90m5:10:48 PM[0m] Found 0 errors. Watching for file changes.
|
|
152
130
|
|
|
153
|
-
[2J[3J[H[[
|
|
131
|
+
[2J[3J[H[[90m6:22:27 PM[0m] File change detected. Starting incremental compilation...
|
|
154
132
|
|
|
155
|
-
[[
|
|
133
|
+
[[90m6:22:27 PM[0m] Found 0 errors. Watching for file changes.
|
|
156
134
|
|
|
157
|
-
[2J[3J[H[[
|
|
135
|
+
[2J[3J[H[[90m6:22:27 PM[0m] File change detected. Starting incremental compilation...
|
|
158
136
|
|
|
159
|
-
[[
|
|
137
|
+
[[90m6:22:27 PM[0m] Found 0 errors. Watching for file changes.
|
|
160
138
|
|
|
161
|
-
[2J[3J[H[[
|
|
139
|
+
[2J[3J[H[[90m6:27:43 PM[0m] File change detected. Starting incremental compilation...
|
|
162
140
|
|
|
163
|
-
[[
|
|
141
|
+
[[90m6:27:43 PM[0m] Found 0 errors. Watching for file changes.
|
|
164
142
|
|
|
165
|
-
[2J[3J[H[[
|
|
143
|
+
[2J[3J[H[[90m6:30:58 PM[0m] File change detected. Starting incremental compilation...
|
|
166
144
|
|
|
167
|
-
[[
|
|
145
|
+
[[90m6:30:58 PM[0m] Found 0 errors. Watching for file changes.
|
|
168
146
|
|
|
169
|
-
[2J[3J[H[[
|
|
147
|
+
[2J[3J[H[[90m6:33:22 PM[0m] File change detected. Starting incremental compilation...
|
|
170
148
|
|
|
171
|
-
[[
|
|
149
|
+
[[90m6:33:22 PM[0m] Found 0 errors. Watching for file changes.
|
|
172
150
|
|
|
173
|
-
[2J[3J[H[[
|
|
151
|
+
[2J[3J[H[[90m6:43:19 PM[0m] File change detected. Starting incremental compilation...
|
|
174
152
|
|
|
175
|
-
[[
|
|
153
|
+
[[90m6:43:19 PM[0m] Found 0 errors. Watching for file changes.
|
|
176
154
|
|
|
177
155
|
[41m[30m ELIFECYCLE [39m[49m [31mCommand failed.[39m
|
|
@@ -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,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqrzro/auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.3",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@sqrzro/server": "n16",
|
|
9
|
-
"zod": "^4.
|
|
10
|
-
"@sqrzro/ui": "^4.0.0-alpha.
|
|
9
|
+
"zod": "^4.3.6",
|
|
10
|
+
"@sqrzro/ui": "^4.0.0-alpha.4"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/react": "^19.2.7",
|
|
@@ -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
|
|