rlz-engine 1.0.21 → 1.0.22

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.
@@ -23,6 +23,7 @@ export function SignupSigninScreen({ appName }) {
23
23
  }
24
24
  function SignupForm() {
25
25
  const navigate = useNavigate();
26
+ const login = useAuthState(i => i.login);
26
27
  const [syncInProgress, setSyncInProgress] = useState(false);
27
28
  const [name, setName] = useState('');
28
29
  const [nameActivated, setNameActivated] = useState(false);
@@ -36,7 +37,7 @@ function SignupForm() {
36
37
  setSyncInProgress(true);
37
38
  setTimeout(async () => {
38
39
  try {
39
- await signup(name, email, password, password2);
40
+ await signup(login, name, email, password, password2);
40
41
  void navigate('/');
41
42
  }
42
43
  finally {
@@ -70,8 +71,7 @@ function SignupForm() {
70
71
  marginLeft: '-12px'
71
72
  } })))));
72
73
  }
73
- async function signup(name, email, password, password2) {
74
- const login = useAuthState(i => i.login);
74
+ async function signup(login, name, email, password, password2) {
75
75
  if (name === ''
76
76
  || !isValidEmail(email)
77
77
  || password === ''
@@ -82,6 +82,7 @@ async function signup(name, email, password, password2) {
82
82
  login(resp.id, resp.name, resp.email, resp.tempPassword);
83
83
  }
84
84
  function SigninForm() {
85
+ const login = useAuthState(i => i.login);
85
86
  const [syncInProgress, setSyncInProgress] = useState(false);
86
87
  const navigate = useNavigate();
87
88
  const [name, setName] = useState('');
@@ -90,7 +91,7 @@ function SigninForm() {
90
91
  setSyncInProgress(true);
91
92
  setTimeout(async () => {
92
93
  try {
93
- await signin(name, password);
94
+ await signin(login, name, password);
94
95
  void navigate('/');
95
96
  }
96
97
  finally {
@@ -117,8 +118,7 @@ function SigninForm() {
117
118
  marginLeft: '-12px'
118
119
  } })))));
119
120
  }
120
- async function signin(name, password) {
121
- const login = useAuthState(i => i.login);
121
+ async function signin(login, name, password) {
122
122
  const resp = await apiSignin(name, password);
123
123
  login(resp.id, resp.name, resp.email, resp.tempPassword);
124
124
  }
@@ -1,5 +1,5 @@
1
1
  import { AuthParam } from '../api/api';
2
- interface AuthState {
2
+ export interface AuthState {
3
3
  id: string | null;
4
4
  name: string | null;
5
5
  email: string | null;
@@ -19,4 +19,3 @@ export declare const useAuthState: import("zustand").UseBoundStore<Omit<import("
19
19
  getOptions: () => Partial<import("zustand/middleware").PersistOptions<AuthState, AuthState>>;
20
20
  };
21
21
  }>;
22
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rlz-engine",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Deps and tools for my style of development",
5
5
  "scripts": {
6
6
  "build": "tsc",