@sqrzro/auth 2.0.0-bz.13 → 2.0.0-bz.15

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,4 +1,5 @@
1
1
 
2
- > @sqrzro/auth@2.0.0-bz.9 build /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
2
+ 
3
+ > @sqrzro/auth@2.0.0-r19.1 build /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
3
4
  > tsc -p tsconfig.json
4
5
 
@@ -1,122 +1,16 @@
1
1
 
2
- > @sqrzro/auth@2.0.0-bz.7 dev /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
2
+ > @sqrzro/auth@2.0.0-bz.14 dev /Users/richard/Sites/@sqrzro/sqrzro/packages/auth
3
3
  > tsc -p tsconfig.json --watch
4
4
 
5
- c[8:15:08 PM] Starting compilation in watch mode...
5
+ c[10:17:27 AM] Starting compilation in watch mode...
6
6
 
7
- src/components/LoginForm/index.tsx:25:14 - error TS2322: Type '{ children: Element[]; classNames: { root: string; }; action: (formData: FormData) => void; errors: Record<string, string>; formData: Partial<LoginFormFields>; hiddenFields?: string[]; innerRef: RefObject<...>; isLoading: boolean; }' is not assignable to type 'Readonly<FormProps>'.
8
- The types returned by 'action(...)' are incompatible between these types.
9
- Type 'void' is not assignable to type 'Promise<void>'.
7
+ [10:17:29 AM] Found 0 errors. Watching for file changes.
10
8
 
11
- 25 <Form {...formProps} classNames={{ root: classNames?.form }}>
12
-    ~~~~
9
+ c[10:17:33 AM] File change detected. Starting incremental compilation...
13
10
 
14
- src/components/MFAForm/index.tsx:14:10 - error TS2322: Type '{ children: Element[]; action: (formData: FormData) => void; errors: Record<string, string>; formData: MFAFormFields; hiddenFields?: string[]; innerRef: RefObject<HTMLFormElement>; isLoading: boolean; }' is not assignable to type 'Readonly<FormProps>'.
15
- Types of property 'action' are incompatible.
16
- Type '(formData: FormData) => void' is not assignable to type '(formData: FormData) => Promise<void>'.
11
+ [10:17:33 AM] Found 0 errors. Watching for file changes.
17
12
 
18
- 14 <Form {...formProps}>
19
-    ~~~~
13
+ c[10:17:37 AM] File change detected. Starting incremental compilation...
20
14
 
21
- src/components/PasswordForm/index.tsx:51:18 - error TS2322: Type '{ children: Element[]; classNames: { root: string; }; action: (formData: FormData) => void; errors: Record<string, string>; formData: Partial<PasswordFormFields>; hiddenFields?: string[]; innerRef: RefObject<...>; isLoading: boolean; }' is not assignable to type 'Readonly<FormProps>'.
22
- Types of property 'action' are incompatible.
23
- Type '(formData: FormData) => void' is not assignable to type '(formData: FormData) => Promise<void>'.
24
-
25
- 51 <Form {...formProps} classNames={{ root: classNames?.form }}>
26
-    ~~~~
27
-
28
- src/components/PasswordResetForm/index.tsx:33:10 - error TS2322: Type '{ children: Element[]; classNames: { root: string; }; action: (formData: FormData) => void; errors: Record<string, string>; formData: Partial<PasswordResetFormFields>; hiddenFields?: string[]; innerRef: RefObject<...>; isLoading: boolean; }' is not assignable to type 'Readonly<FormProps>'.
29
- Types of property 'action' are incompatible.
30
- Type '(formData: FormData) => void' is not assignable to type '(formData: FormData) => Promise<void>'.
31
-
32
- 33 <Form {...formProps} classNames={{ root: classNames?.form }}>
33
-    ~~~~
34
-
35
- src/server.ts:4:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'handleLoginForm'.
36
-
37
- 4 handleLoginForm,
38
-    ~~~~~~~~~~~~~~~
39
-
40
- src/server.ts:5:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'handleLogout'.
41
-
42
- 5 handleLogout,
43
-    ~~~~~~~~~~~~
44
-
45
- src/server.ts:6:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'handleMFAForm'.
46
-
47
- 6 handleMFAForm,
48
-    ~~~~~~~~~~~~~
49
-
50
- src/server.ts:7:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'handlePasswordForm'.
51
-
52
- 7 handlePasswordForm,
53
-    ~~~~~~~~~~~~~~~~~~
54
-
55
- src/server.ts:8:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'handlePasswordResetWithTokenForm'.
56
-
57
- 8 handlePasswordResetWithTokenForm,
58
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59
-
60
- src/server.ts:9:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'checkUserHasMFA'.
61
-
62
- 9 checkUserHasMFA as serverCheckUserHasMFA,
63
-    ~~~~~~~~~~~~~~~
64
-
65
- src/server.ts:10:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'generateMFA'.
66
-
67
- 10 generateMFA as serverGenerateMFA,
68
-    ~~~~~~~~~~~
69
-
70
- src/server.ts:11:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'getSessionUser'.
71
-
72
- 11 getSessionUser as serverGetSessionUser,
73
-    ~~~~~~~~~~~~~~
74
-
75
- src/server.ts:12:5 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'checkMFAEnabled'.
76
-
77
- 12 checkMFAEnabled as syncCheckMFAEnabled,
78
-    ~~~~~~~~~~~~~~~
79
-
80
- src/server.ts:14:15 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'LoginFormFields'.
81
-
82
- 14 import type { LoginFormFields, MFAFormFields, UserObject } from '@sqrzro/server/auth';
83
-    ~~~~~~~~~~~~~~~
84
-
85
- src/server.ts:14:32 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'MFAFormFields'.
86
-
87
- 14 import type { LoginFormFields, MFAFormFields, UserObject } from '@sqrzro/server/auth';
88
-    ~~~~~~~~~~~~~
89
-
90
- src/server.ts:14:47 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'UserObject'.
91
-
92
- 14 import type { LoginFormFields, MFAFormFields, UserObject } from '@sqrzro/server/auth';
93
-    ~~~~~~~~~~
94
-
95
- src/server.ts:17:15 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'MFAFormFields'.
96
-
97
- 17 export type { MFAFormFields, ScopeObject } from '@sqrzro/server/auth';
98
-    ~~~~~~~~~~~~~
99
-
100
- src/server.ts:17:30 - error TS2305: Module '"@sqrzro/server/auth"' has no exported member 'ScopeObject'.
101
-
102
- 17 export type { MFAFormFields, ScopeObject } from '@sqrzro/server/auth';
103
-    ~~~~~~~~~~~
104
-
105
- [8:15:10 PM] Found 18 errors. Watching for file changes.
106
-
107
- c[8:15:12 PM] File change detected. Starting incremental compilation...
108
-
109
- src/components/LoginForm/index.tsx:25:14 - error TS2322: Type '{ children: Element[]; classNames: { root: string; }; action: (formData: FormData) => void; errors: Record<string, string>; formData: Partial<LoginFormFields>; hiddenFields?: string[]; innerRef: RefObject<...>; isLoading: boolean; }' is not assignable to type 'Readonly<FormProps>'.
110
- The types returned by 'action(...)' are incompatible between these types.
111
- Type 'void' is not assignable to type 'Promise<void>'.
112
-
113
- 25 <Form {...formProps} classNames={{ root: classNames?.form }}>
114
-    ~~~~
115
-
116
- src/components/MFAForm/index.tsx:14:10 - error TS2322: Type '{ children: Element[]; action: (formData: FormData) => void; errors: Record<string, string>; formData: MFAFormFields; hiddenFields?: string[]; innerRef: RefObject<HTMLFormElement>; isLoading: boolean; }' is not assignable to type 'Readonly<FormProps>'.
117
- Types of property 'action' are incompatible.
118
- Type '(formData: FormData) => void' is not assignable to type '(formData: FormData) => Promise<void>'.
119
-
120
- 14 <Form {...formProps}>
121
-    ~~~~
15
+ [10:17:37 AM] Found 0 errors. Watching for file changes.
122
16
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ClassNameProps } from '@sqrzro/components';
3
2
  import type { ScopeObject } from '../../server';
4
3
  export interface AuthClassNames {
@@ -37,7 +37,6 @@ async function Auth({ classNames, logo, onLogin, onPassword, params: { auth }, s
37
37
  if (auth.length > 1) {
38
38
  return notFound();
39
39
  }
40
- console.log('auth2', auth);
41
40
  await registerAuthEvents({ login: onLogin, password: onPassword });
42
41
  return (_jsxs("div", { className: tw(classNames?.root), children: [_jsx("div", { className: tw(classNames?.logo), children: logo }), _jsx("div", { className: tw(classNames?.panel), children: getPage(auth[0], {
43
42
  classNames,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AuthClassNames } from '../Auth';
3
2
  export interface LoginFormProps {
4
3
  classNames?: Partial<AuthClassNames>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface LogoutButtonProps {
3
2
  children?: React.ReactElement | string;
4
3
  redirectTo?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface MFAFormProps {
3
2
  }
4
3
  declare function MFAForm(): React.ReactElement;
@@ -5,7 +5,6 @@ import useMFAForm from '../../hooks/useMFAForm';
5
5
  import { submitMFAForm } from '../../server';
6
6
  function MFAForm() {
7
7
  const { formProps, fieldProps, isLoading, key } = useMFAForm({ onSubmit: submitMFAForm });
8
- console.log('mfa form', isLoading, key);
9
8
  return (_jsxs(Form, { ...formProps, children: [_jsx(CodeFormField, { ...fieldProps('token'), hasAssistiveLabel: true, isAutoFocus: true }, key), _jsx(FormSubmit, { isLoading: isLoading, children: "Verify" })] }));
10
9
  }
11
10
  export default MFAForm;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AuthClassNames } from '../Auth';
3
2
  export interface MFAPageProps {
4
3
  classNames?: Partial<AuthClassNames>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AuthClassNames } from '../Auth';
3
2
  export interface MFASetupProps {
4
3
  classNames?: Partial<AuthClassNames>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AuthClassNames } from '../Auth';
3
2
  export interface MFASetupFormProps {
4
3
  classNames?: Partial<AuthClassNames>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AuthClassNames } from '../Auth';
3
2
  interface PasswordFormProps {
4
3
  classNames?: Partial<AuthClassNames>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AuthClassNames } from '../Auth';
3
2
  interface PasswordPageProps {
4
3
  classNames?: Partial<AuthClassNames>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AuthClassNames } from '../Auth';
3
2
  interface PasswordResetFormProps {
4
3
  classNames?: Partial<AuthClassNames>;
package/dist/server.js CHANGED
@@ -39,6 +39,7 @@ async function sendPasswordResetMail(email, token) {
39
39
  return authEvents.password?.(email, token) || false;
40
40
  }
41
41
  export async function submitPasswordForm(formData) {
42
+ console.log('[--] Submitting password form', formData);
42
43
  return handlePasswordForm(formData, sendPasswordResetMail);
43
44
  }
44
45
  export async function submitPasswordResetForm(formData) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sqrzro/auth",
3
3
  "type": "module",
4
- "version": "2.0.0-bz.13",
4
+ "version": "2.0.0-bz.15",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
@@ -75,8 +75,6 @@ async function Auth({
75
75
  return notFound();
76
76
  }
77
77
 
78
- console.log('auth2', auth);
79
-
80
78
  await registerAuthEvents({ login: onLogin, password: onPassword });
81
79
 
82
80
  return (
@@ -10,8 +10,6 @@ export interface MFAFormProps {}
10
10
  function MFAForm(): React.ReactElement {
11
11
  const { formProps, fieldProps, isLoading, key } = useMFAForm({ onSubmit: submitMFAForm });
12
12
 
13
- console.log('mfa form', isLoading, key);
14
-
15
13
  return (
16
14
  <Form {...formProps}>
17
15
  <CodeFormField key={key} {...fieldProps('token')} hasAssistiveLabel isAutoFocus />
package/src/server.ts CHANGED
@@ -81,6 +81,7 @@ async function sendPasswordResetMail(email: string, token: string): Promise<bool
81
81
  export async function submitPasswordForm(
82
82
  formData: PasswordFormFields
83
83
  ): Promise<Errorable<boolean>> {
84
+ console.log('[--] Submitting password form', formData);
84
85
  return handlePasswordForm(formData, sendPasswordResetMail);
85
86
  }
86
87