@solidstarters/solid-core-ui 1.1.9 → 1.1.10

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.
Files changed (45) hide show
  1. package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
  2. package/dist/components/auth/SolidForgotPassword.js +1 -4
  3. package/dist/components/auth/SolidForgotPassword.js.map +1 -1
  4. package/dist/components/auth/SolidInitialLoginOtp.d.ts +5 -0
  5. package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -0
  6. package/dist/components/auth/SolidInitialLoginOtp.js +122 -0
  7. package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -0
  8. package/dist/components/auth/SolidInitiateRegisterOtp.d.ts +5 -0
  9. package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -0
  10. package/dist/components/auth/SolidInitiateRegisterOtp.js +122 -0
  11. package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -0
  12. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  13. package/dist/components/auth/SolidLogin.js +62 -19
  14. package/dist/components/auth/SolidLogin.js.map +1 -1
  15. package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -1
  16. package/dist/components/auth/SolidOTPVerify.js +12 -9
  17. package/dist/components/auth/SolidOTPVerify.js.map +1 -1
  18. package/dist/components/auth/SolidRegister.d.ts.map +1 -1
  19. package/dist/components/auth/SolidRegister.js +123 -75
  20. package/dist/components/auth/SolidRegister.js.map +1 -1
  21. package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
  22. package/dist/components/auth/SolidResetPassword.js +11 -9
  23. package/dist/components/auth/SolidResetPassword.js.map +1 -1
  24. package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
  25. package/dist/components/common/SocialMediaLogin.js +4 -2
  26. package/dist/components/common/SocialMediaLogin.js.map +1 -1
  27. package/dist/index.d.ts +4 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +4 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/redux/api/authApi.d.ts +5 -1
  32. package/dist/redux/api/authApi.d.ts.map +1 -1
  33. package/dist/redux/api/authApi.js +37 -1
  34. package/dist/redux/api/authApi.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/components/auth/SolidForgotPassword.tsx +0 -2
  37. package/src/components/auth/SolidInitialLoginOtp.tsx +134 -0
  38. package/src/components/auth/SolidInitiateRegisterOtp.tsx +134 -0
  39. package/src/components/auth/SolidLogin.tsx +72 -17
  40. package/src/components/auth/SolidOTPVerify.tsx +9 -6
  41. package/src/components/auth/SolidRegister.tsx +205 -154
  42. package/src/components/auth/SolidResetPassword.tsx +9 -7
  43. package/src/components/common/SocialMediaLogin.tsx +6 -1
  44. package/src/index.ts +7 -2
  45. package/src/redux/api/authApi.ts +48 -8
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
 
3
- import { useRegisterMutation } from "@/redux/api/authApi";
3
+ import { useInitateRegisterMutation, useRegisterMutation } from "@/redux/api/authApi";
4
+ import { useLazyGetAuthSettingsQuery } from "@/redux/api/solidSettingsApi";
4
5
  import { FetchBaseQueryError } from "@reduxjs/toolkit/query/react";
5
- import { useFormik } from "formik";
6
+ import { Form, Formik } from "formik";
6
7
  import Link from "next/link";
7
8
  import { useRouter } from "next/navigation";
8
9
  import { Button } from "primereact/button";
@@ -10,33 +11,19 @@ import { Divider } from "primereact/divider";
10
11
  import { InputText } from "primereact/inputtext";
11
12
  import { Message } from "primereact/message";
12
13
  import { Password } from "primereact/password";
14
+ import { TabPanel, TabView } from "primereact/tabview";
13
15
  import { Toast } from "primereact/toast";
14
16
  import { classNames } from "primereact/utils";
15
- import { ChangeEventHandler, useContext, useEffect, useRef, useState } from "react";
17
+ import { useEffect, useRef } from "react";
16
18
  import * as Yup from "yup";
17
19
  import { SocialMediaLogin } from "../common/SocialMediaLogin";
18
- import { LayoutContext } from "../layout/context/layoutcontext";
19
20
 
20
21
  const SolidRegister = () => {
21
- const { layoutConfig } = useContext(LayoutContext);
22
- const { authLayout } = layoutConfig;
22
+ const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
23
+ useEffect(() => {
24
+ trigger("")
25
+ }, [trigger])
23
26
  const toast = useRef<Toast>(null);
24
- const [password, setPassword] = useState("");
25
- const [checked, setChecked] = useState<boolean>(false);
26
- const [showPassword, setShowPassword] = useState(false);
27
- const [user, setUser] = useState({
28
- name: "",
29
- email: "",
30
- password: "",
31
- });
32
-
33
- const validationSchema = Yup.object({
34
- username: Yup.string().required("User Name is required"),
35
- email: Yup.string()
36
- .email("Invalid email address")
37
- .required("Email is required"),
38
- password: Yup.string().required("Password is required"),
39
- });
40
27
 
41
28
  const router = useRouter();
42
29
 
@@ -45,34 +32,7 @@ const SolidRegister = () => {
45
32
 
46
33
  const [register, { isLoading, error, isSuccess, data }] = useRegisterMutation();
47
34
 
48
- const onChange: ChangeEventHandler<HTMLInputElement> = (e) => {
49
- setUser({ ...user, [e.target.name]: e.target.value });
50
- };
51
-
52
- const initialValues = {
53
- username: "",
54
- email: "",
55
- password: "",
56
- }
57
-
58
- const formik = useFormik({
59
- initialValues,
60
- validationSchema,
61
- enableReinitialize: true,
62
- onSubmit: async (values) => {
63
- try {
64
- const userData = {
65
- username: values.username,
66
- email: values.email,
67
- password: values.password,
68
- };
69
-
70
- await register(userData);
71
- } catch (err) {
72
- console.log('inside', err);
73
- }
74
- }
75
- });
35
+ const [initiateOtpRegister] = useInitateRegisterMutation();
76
36
 
77
37
  const showError = () => {
78
38
  if (error) {
@@ -111,11 +71,19 @@ const SolidRegister = () => {
111
71
  router.replace("/auth/login");
112
72
  }
113
73
  }, [isSuccess])
74
+ const showToast = (severity: "success" | "error", summary: string, detail: string) => {
75
+ toast.current?.show({
76
+ severity,
77
+ summary,
78
+ detail,
79
+ life: 3000,
80
+ });
81
+ };
114
82
  return (
115
- <>
83
+ <div className="">
116
84
  <Toast ref={toast} />
117
- <div className={`auth-container ${authLayout === 'Center' ? 'center' : 'side'}`}>
118
- {authLayout === 'Center' &&
85
+ <div className={`auth-container ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'center' : 'side'}`}>
86
+ {solidSettingsData?.data?.authPagesLayout === 'center' &&
119
87
  <div className="flex justify-content-center">
120
88
  <div className="solid-logo flex align-items-center gap-3">
121
89
  <img
@@ -131,115 +99,198 @@ const SolidRegister = () => {
131
99
  </div>
132
100
  </div>
133
101
  }
134
- <h2 className={`solid-auth-title ${authLayout === 'Center' ? 'text-center' : 'text-left'}`}>Sign Up To Your Account</h2>
102
+ <h2 className={`solid-auth-title ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`}>Sign Up To Your Account</h2>
135
103
  {/* <p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p> */}
136
- <>
137
- <form onSubmit={formik.handleSubmit}>
138
- {/* <div className="grid">
139
- <div className="col-6">
140
- <div className="flex flex-column gap-2">
141
- <label htmlFor="email" className="solid-auth-input-label">First Name</label>
142
- <InputText
143
- id="username"
144
- name="username"
145
- placeholder="username"
146
- onChange={formik.handleChange}
147
- value={formik.values.username}
148
- />
149
- {isFormFieldValid(formik, "username") && <Message
150
- className="text-red-500 text-sm"
151
- severity="error"
152
- text={formik?.errors?.username?.toString()}
153
- />}
154
- </div>
155
- </div>
156
- <div className="col-6">
157
- <div className="flex flex-column gap-2">
158
- <label htmlFor="email" className="solid-auth-input-label">Last Name</label>
159
- <InputText
160
- id="email"
161
- name="email"
162
- placeholder="Yourgmail@123.com"
163
- onChange={formik.handleChange}
164
- value={formik.values.email}
165
- />
166
- {isFormFieldValid(formik, "email") && <Message
167
- className="text-red-500 text-sm"
168
- severity="error"
169
- text={formik?.errors?.email?.toString()}
170
- />}
171
- </div>
104
+ <TabView className="solid-auth-tabview">
105
+ <TabPanel header="With Password">
106
+ <Formik
107
+ initialValues={{
108
+ username: "",
109
+ email: "",
110
+ password: "",
111
+ }}
112
+ validationSchema={Yup.object({
113
+ username: Yup.string().required("User Name is required"),
114
+ email: Yup.string()
115
+ .email("Invalid email address")
116
+ .required("Email is required"),
117
+ password: Yup.string().required("Password is required"),
118
+ })}
119
+ onSubmit={async (values, { setSubmitting }) => {
120
+ try {
121
+ const userData = {
122
+ username: values.username,
123
+ email: values.email,
124
+ password: values.password,
125
+ };
126
+
127
+ const response = await register(userData).unwrap();
128
+ if (response?.statusCode === 200) {
129
+ showToast("success", "User Registered", response?.data?.message);
130
+ router.push(`/auth/login`);
131
+ } else {
132
+ showToast("error", "Login Error", response.error);
133
+ }
134
+ } catch (err: any) {
135
+ showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
136
+ } finally {
137
+ setSubmitting(false);
138
+ }
139
+ }}
140
+ >
141
+ {(formik) => (
142
+ <Form>
143
+ <div className="flex flex-column gap-2 mt-3">
144
+ <label htmlFor="email" className="solid-auth-input-label">Username</label>
145
+ <InputText
146
+ id="username"
147
+ name="username"
148
+ placeholder="username"
149
+ onChange={formik.handleChange}
150
+ value={formik.values.username}
151
+ />
152
+ {isFormFieldValid(formik, "username") && <Message
153
+ className="text-red-500 text-sm"
154
+ severity="error"
155
+ text={formik?.errors?.username?.toString()}
156
+ />}
157
+ </div>
158
+ <div className="flex flex-column gap-2 mt-3">
159
+ <label htmlFor="email" className="solid-auth-input-label">Email</label>
160
+ <InputText
161
+ id="email"
162
+ name="email"
163
+ placeholder="Yourgmail@123.com"
164
+ onChange={formik.handleChange}
165
+ value={formik.values.email}
166
+ />
167
+ {isFormFieldValid(formik, "email") && <Message
168
+ className="text-red-500 text-sm"
169
+ severity="error"
170
+ text={formik?.errors?.email?.toString()}
171
+ />}
172
+ </div>
173
+ <div className="flex flex-column gap-2 mt-3">
174
+ <label htmlFor="password" className="solid-auth-input-label">Password</label>
175
+ <Password
176
+ id="password"
177
+ name="password"
178
+ value={formik.values.password}
179
+ onChange={formik.handleChange}
180
+ placeholder="***************"
181
+ toggleMask
182
+ className={classNames("", {
183
+ "p-invalid": isFormFieldValid(formik, "password"),
184
+ })}
185
+ inputClassName="w-full"
186
+ feedback={false}
187
+ />
188
+ {isFormFieldValid(formik, "password") && <Message
189
+ className="text-red-500 text-sm"
190
+ severity="error"
191
+ text={formik?.errors?.password?.toString()}
192
+ />}
193
+ </div>
194
+ <div className="mt-4">
195
+ <Button className="w-full font-light auth-submit-button" label="Sign Up" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
196
+ </div>
197
+ </Form>
198
+ )}
199
+ </Formik>
200
+ </TabPanel>
201
+ <TabPanel header="Without Password">
202
+ <Formik
203
+ initialValues={{
204
+ username: "",
205
+ email: "",
206
+ }}
207
+ validationSchema={Yup.object({
208
+ username: Yup.string().required("User Name is required"),
209
+ email: Yup.string()
210
+ .email("Invalid email address")
211
+ .required("Email is required"),
212
+ })}
213
+ onSubmit={async (values, { setSubmitting }) => {
214
+ try {
215
+ const payload = {
216
+ username: values.username,
217
+ email: values.email,
218
+ validationSources: ["email"]
219
+ };
220
+
221
+ const response = await initiateOtpRegister(payload).unwrap(); // Call mutation trigger
222
+
223
+ if (response?.statusCode === 200) {
224
+ showToast("success", "OTP sent Successfully", response?.data?.message);
225
+ const email = values.email;
226
+ router.push(`/auth/initiate-register?email=${email}`);
227
+ } else {
228
+ showToast("error", "Login Error", response.error);
229
+ }
230
+ } catch (err: any) {
231
+ showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
232
+ } finally {
233
+ setSubmitting(false);
234
+ }
235
+ }}
236
+ >
237
+ {(formik) => (
238
+ <Form>
239
+ <div className="flex flex-column gap-2 mt-3">
240
+ <label htmlFor="email" className="solid-auth-input-label">Username</label>
241
+ <InputText
242
+ id="username"
243
+ name="username"
244
+ placeholder="username"
245
+ onChange={formik.handleChange}
246
+ value={formik.values.username}
247
+ />
248
+ {isFormFieldValid(formik, "username") && <Message
249
+ className="text-red-500 text-sm"
250
+ severity="error"
251
+ text={formik?.errors?.username?.toString()}
252
+ />}
253
+ </div>
254
+ <div className="flex flex-column gap-2 mt-3">
255
+ <label htmlFor="email" className="solid-auth-input-label">Email</label>
256
+ <InputText
257
+ id="email"
258
+ name="email"
259
+ placeholder="Yourgmail@123.com"
260
+ onChange={formik.handleChange}
261
+ value={formik.values.email}
262
+ />
263
+ {isFormFieldValid(formik, "email") && <Message
264
+ className="text-red-500 text-sm"
265
+ severity="error"
266
+ text={formik?.errors?.email?.toString()}
267
+ />}
268
+ </div>
269
+ <div className="mt-4">
270
+ <Button className="w-full font-light auth-submit-button" label="Sign Up" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
271
+ </div>
272
+ </Form>
273
+ )}
274
+ </Formik>
275
+ </TabPanel>
276
+ </TabView>
277
+ {solidSettingsData?.data?.iamGoogleOAuthEnabled &&
278
+ <>
279
+ <Divider align="center">
280
+ <div className="inline-flex align-items-center">
281
+ or
172
282
  </div>
173
- </div> */}
174
- <div className="flex flex-column gap-2 mt-3">
175
- <label htmlFor="email" className="solid-auth-input-label">Username</label>
176
- <InputText
177
- id="username"
178
- name="username"
179
- placeholder="username"
180
- onChange={formik.handleChange}
181
- value={formik.values.username}
182
- />
183
- {isFormFieldValid(formik, "username") && <Message
184
- className="text-red-500 text-sm"
185
- severity="error"
186
- text={formik?.errors?.username?.toString()}
187
- />}
188
- </div>
189
- <div className="flex flex-column gap-2 mt-3">
190
- <label htmlFor="email" className="solid-auth-input-label">Email</label>
191
- <InputText
192
- id="email"
193
- name="email"
194
- placeholder="Yourgmail@123.com"
195
- onChange={formik.handleChange}
196
- value={formik.values.email}
197
- />
198
- {isFormFieldValid(formik, "email") && <Message
199
- className="text-red-500 text-sm"
200
- severity="error"
201
- text={formik?.errors?.email?.toString()}
202
- />}
203
- </div>
204
- <div className="flex flex-column gap-2 mt-3">
205
- <label htmlFor="password" className="solid-auth-input-label">Password</label>
206
- <Password
207
- id="password"
208
- name="password"
209
- value={formik.values.password}
210
- onChange={formik.handleChange}
211
- placeholder="***************"
212
- toggleMask
213
- className={classNames("", {
214
- "p-invalid": isFormFieldValid(formik, "password"),
215
- })}
216
- inputClassName="w-full"
217
- feedback={false}
218
- />
219
- {isFormFieldValid(formik, "password") && <Message
220
- className="text-red-500 text-sm"
221
- severity="error"
222
- text={formik?.errors?.password?.toString()}
223
- />}
224
- </div>
225
- <div className="mt-4">
226
- <Button className="w-full font-light auth-submit-button" label="Sign Up" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
227
- </div>
228
- </form>
229
- </>
230
- <Divider align="center">
231
- <div className="inline-flex align-items-center">
232
- or
233
- </div>
234
- </Divider>
235
- <SocialMediaLogin />
283
+ </Divider>
284
+ <SocialMediaLogin />
285
+ </>
286
+ }
236
287
  </div>
237
288
  <div className="text-center mt-5">
238
289
  <div className="text-sm text-400 secondary-dark-color">
239
290
  Already have an account ? <Link className="font-bold" href="/auth/login">Sign In</Link>
240
291
  </div>
241
292
  </div>
242
- </>
293
+ </div>
243
294
  );
244
295
  };
245
296
 
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useConfirmForgotPasswordMutation } from "@/redux/api/authApi";
4
+ import { useLazyGetAuthSettingsQuery } from "@/redux/api/solidSettingsApi";
4
5
  import { useFormik } from "formik";
5
6
  import Link from "next/link";
6
7
  import { useRouter } from "next/navigation";
@@ -9,14 +10,15 @@ import { Message } from "primereact/message";
9
10
  import { Password } from "primereact/password";
10
11
  import { Toast } from "primereact/toast";
11
12
  import { classNames } from "primereact/utils";
12
- import { useContext, useRef } from "react";
13
+ import { useEffect, useRef } from "react";
13
14
  import * as Yup from "yup";
14
- import { LayoutContext } from "../layout/context/layoutcontext";
15
15
 
16
16
 
17
17
  const SolidResetPassword = ({ verificationToken, username }: { verificationToken?: any, username?: any }) => {
18
- const { layoutConfig } = useContext(LayoutContext);
19
- const { authLayout } = layoutConfig;
18
+ const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
19
+ useEffect(() => {
20
+ trigger("")
21
+ }, [trigger])
20
22
  const toast = useRef<Toast>(null);
21
23
  const router = useRouter();
22
24
 
@@ -71,8 +73,8 @@ const SolidResetPassword = ({ verificationToken, username }: { verificationToken
71
73
  return (
72
74
  <>
73
75
  <Toast ref={toast} />
74
- <div className={`auth-container ${authLayout === 'Center' ? 'center' : 'side'}`}>
75
- {authLayout === 'Center' &&
76
+ <div className={`auth-container ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'center' : 'side'}`}>
77
+ {solidSettingsData?.data?.authPagesLayout === 'center' &&
76
78
  <div className="flex justify-content-center">
77
79
  <div className="solid-logo flex align-items-center gap-3">
78
80
  <img
@@ -88,7 +90,7 @@ const SolidResetPassword = ({ verificationToken, username }: { verificationToken
88
90
  </div>
89
91
  </div>
90
92
  }
91
- <h2 className={`solid-auth-title ${authLayout === 'Center' ? 'text-center' : 'text-left'}`}>Create New Password</h2>
93
+ <h2 className={`solid-auth-title ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`}>Create New Password</h2>
92
94
  {/* <p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p> */}
93
95
  <form onSubmit={formik.handleSubmit}>
94
96
  <div className="flex flex-column gap-2">
@@ -1,8 +1,12 @@
1
+ "use client"
1
2
  import { signIn } from 'next-auth/react'
3
+ import { useRouter } from 'next/navigation';
2
4
  import { Button } from 'primereact/button'
3
5
  import React from 'react'
4
6
 
5
7
  export const SocialMediaLogin = () => {
8
+ const router = useRouter();
9
+
6
10
  return (
7
11
  <div className="flex justify-content-center mt-4 gap-3">
8
12
  <Button icon={() => (
@@ -26,7 +30,8 @@ export const SocialMediaLogin = () => {
26
30
  outlined
27
31
  severity="secondary"
28
32
  label='Sign In with Google'
29
- onClick={()=>signIn('google', {callbackUrl :'/admin/core/solid-core/user/list'})}
33
+ onClick={() => router.push(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/iam/google/connect`)}
34
+ // onClick={()=>signIn('google', {callbackUrl :'https://uat-api.lm.solidxai.com/api/iam/google/connect'})}
30
35
  >
31
36
  </Button>
32
37
  {/* <Button icon={() => (
package/src/index.ts CHANGED
@@ -417,7 +417,7 @@ export { revalidateTag } from '@/helpers/revalidate';
417
417
  // │ └── userSlice.ts
418
418
  // ├── hooks.ts
419
419
  // export * from '@/redux/api/articleApi';
420
- export { authApi, useForgotPasswordMutation, useRegisterMutation, useRegisterPrivateMutation, useResetPasswordMutation, useUpdateUserMutation } from '@/redux/api/authApi';
420
+ export { authApi, useForgotPasswordMutation, useRegisterMutation, useRegisterPrivateMutation, useResetPasswordMutation, useUpdateUserMutation ,useInitateLoginMutation, useConfirmOtpLoginMutation, useInitateRegisterMutation, useConfirmOtpRegisterMutation,} from '@/redux/api/authApi';
421
421
  // export * from '@/redux/api/automationApi';
422
422
  // export * from '@/redux/api/categoryApi';
423
423
  // export * from '@/redux/api/cityApi';
@@ -443,6 +443,9 @@ export { testApi, useSeederMutation } from '@/redux/api/testApi';
443
443
  // export * from '@/redux/api/ratingApi';
444
444
  // export * from '@/redux/api/reviewApi';
445
445
  // export * from '@/redux/api/roleApi';
446
+ export {
447
+ roleApi, useGetrolesQuery, useGetroleByIdQuery, useCreateroleMutation, useLazyGetrolesQuery, useUpdateroleMutation, useDeleteroleMutation
448
+ } from '@/redux/api/roleApi'
446
449
  export { solidActionsApi, useCreateSolidActionMutation, useDeleteMultipleSolidActionsMutation, useDeleteSolidActionMutation, useGetSolidActionByIdQuery, useGetSolidActionsQuery, useLazyGetSolidActionByIdQuery, useLazyGetSolidActionsQuery, useUpdateSolidActionMutation } from '@/redux/api/solidActionApi';
447
450
  // export * from '@/redux/api/solidCountryApi';
448
451
  export { createSolidEntityApi } from '@/redux/api/solidEntityApi';
@@ -584,6 +587,8 @@ export { default as SolidOTPVerify } from '@/components/auth/SolidOTPVerify';
584
587
  export { default as SolidRegister } from '@/components/auth/SolidRegister';
585
588
  export { default as SolidResetPassword } from '@/components/auth/SolidResetPassword';
586
589
  export { default as SolidChangeForcePassword } from '@/components/auth/SolidChangeForcePassword';
590
+ export { default as SolidInitialLoginOtp } from '@/components/auth/SolidInitialLoginOtp';
591
+ export { default as SolidInitiateRegisterOtp } from '@/components/auth/SolidInitiateRegisterOtp';
587
592
 
588
593
  //redux
589
594
  export { default as authenticationReducer } from '@/redux/features/authSlice';
@@ -593,7 +598,7 @@ export { default as popupReducer } from '@/redux/features/popupSlice';
593
598
  export { default as themeReducer } from '@/redux/features/themeSlice';
594
599
  export { default as userReducer } from '@/redux/features/userSlice';
595
600
 
596
- export {default as GenerateModelCodeRowAction } from '@/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction'
601
+ export { default as GenerateModelCodeRowAction } from '@/components/core/extension/solid-core/modelMetadata/list/GenerateModelCodeRowAction'
597
602
 
598
603
  // types
599
604
  export type { LayoutConfig } from '@/types';
@@ -5,6 +5,24 @@ export const authApi = createApi({
5
5
  reducerPath: "authApi",
6
6
  baseQuery: baseQueryWithAuth,
7
7
  endpoints: (builder) => ({
8
+ initateLogin: builder.mutation({
9
+ query(body) {
10
+ return {
11
+ url: "/iam/otp/login/initiate",
12
+ method: "POST",
13
+ body,
14
+ };
15
+ },
16
+ }),
17
+ confirmOtpLogin: builder.mutation({
18
+ query(body) {
19
+ return {
20
+ url: "/iam/otp/login/confirm",
21
+ method: "POST",
22
+ body,
23
+ };
24
+ },
25
+ }),
8
26
  register: builder.mutation({
9
27
  query(body) {
10
28
  return {
@@ -14,6 +32,24 @@ export const authApi = createApi({
14
32
  };
15
33
  },
16
34
  }),
35
+ initateRegister: builder.mutation({
36
+ query(body) {
37
+ return {
38
+ url: "/iam/otp/register/initiate",
39
+ method: "POST",
40
+ body,
41
+ };
42
+ },
43
+ }),
44
+ confirmOtpRegister: builder.mutation({
45
+ query(body) {
46
+ return {
47
+ url: "/iam/otp/register/confirm",
48
+ method: "POST",
49
+ body,
50
+ };
51
+ },
52
+ }),
17
53
  registerPrivate: builder.mutation({
18
54
  query(body) {
19
55
  return {
@@ -68,13 +104,13 @@ export const authApi = createApi({
68
104
  }),
69
105
  changePassword: builder.mutation({
70
106
  query(body) {
71
- return {
72
- url: `/iam/change-password`,
73
- method: "POST",
74
- body,
75
- };
107
+ return {
108
+ url: `/iam/change-password`,
109
+ method: "POST",
110
+ body,
111
+ };
76
112
  },
77
- }),
113
+ }),
78
114
  }),
79
115
  });
80
116
 
@@ -86,5 +122,9 @@ export const {
86
122
  useResetPasswordMutation,
87
123
  useInitiateChangePasswordMutation,
88
124
  useConfirmForgotPasswordMutation,
89
- useChangePasswordMutation
90
- } = authApi;
125
+ useChangePasswordMutation,
126
+ useInitateLoginMutation,
127
+ useConfirmOtpLoginMutation,
128
+ useInitateRegisterMutation,
129
+ useConfirmOtpRegisterMutation,
130
+ } = authApi;