@solidstarters/solid-core-ui 1.1.16 → 1.1.18

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 (241) hide show
  1. package/dist/components/auth/AuthLayout.d.ts +4 -0
  2. package/dist/components/auth/AuthLayout.d.ts.map +1 -0
  3. package/dist/components/auth/AuthLayout.js +80 -0
  4. package/dist/components/auth/AuthLayout.js.map +1 -0
  5. package/dist/components/auth/ForgotPasswordThankYou.d.ts +2 -0
  6. package/dist/components/auth/ForgotPasswordThankYou.d.ts.map +1 -0
  7. package/dist/components/auth/ForgotPasswordThankYou.js +16 -0
  8. package/dist/components/auth/ForgotPasswordThankYou.js.map +1 -0
  9. package/dist/components/auth/GoogleAuthChecking.d.ts +2 -0
  10. package/dist/components/auth/GoogleAuthChecking.d.ts.map +1 -0
  11. package/dist/components/auth/GoogleAuthChecking.js +99 -0
  12. package/dist/components/auth/GoogleAuthChecking.js.map +1 -0
  13. package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -1
  14. package/dist/components/auth/SolidChangeForcePassword.js +44 -39
  15. package/dist/components/auth/SolidChangeForcePassword.js.map +1 -1
  16. package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
  17. package/dist/components/auth/SolidForgotPassword.js +1 -2
  18. package/dist/components/auth/SolidForgotPassword.js.map +1 -1
  19. package/dist/components/auth/SolidInitialLoginOtp.d.ts +1 -3
  20. package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
  21. package/dist/components/auth/SolidInitialLoginOtp.js +16 -12
  22. package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
  23. package/dist/components/auth/SolidInitiateRegisterOtp.d.ts +1 -3
  24. package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
  25. package/dist/components/auth/SolidInitiateRegisterOtp.js +16 -12
  26. package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
  27. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  28. package/dist/components/auth/SolidLogin.js +12 -8
  29. package/dist/components/auth/SolidLogin.js.map +1 -1
  30. package/dist/components/auth/SolidRegister.d.ts.map +1 -1
  31. package/dist/components/auth/SolidRegister.js +13 -9
  32. package/dist/components/auth/SolidRegister.js.map +1 -1
  33. package/dist/components/auth/SolidResetPassword.d.ts +1 -4
  34. package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
  35. package/dist/components/auth/SolidResetPassword.js +14 -10
  36. package/dist/components/auth/SolidResetPassword.js.map +1 -1
  37. package/dist/components/common/GeneralSettings.d.ts +1 -3
  38. package/dist/components/common/GeneralSettings.d.ts.map +1 -1
  39. package/dist/components/common/GeneralSettings.js +21 -18
  40. package/dist/components/common/GeneralSettings.js.map +1 -1
  41. package/dist/components/common/NotFound.d.ts +2 -0
  42. package/dist/components/common/NotFound.d.ts.map +1 -0
  43. package/dist/components/common/NotFound.js +7 -0
  44. package/dist/components/common/NotFound.js.map +1 -0
  45. package/dist/components/common/SingleSelectAutoCompleteField.d.ts.map +1 -1
  46. package/dist/components/common/SingleSelectAutoCompleteField.js +3 -1
  47. package/dist/components/common/SingleSelectAutoCompleteField.js.map +1 -1
  48. package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
  49. package/dist/components/common/SocialMediaLogin.js +3 -2
  50. package/dist/components/common/SocialMediaLogin.js.map +1 -1
  51. package/dist/components/common/SolidAdmin.d.ts +2 -0
  52. package/dist/components/common/SolidAdmin.d.ts.map +1 -0
  53. package/dist/components/common/SolidAdmin.js +5 -0
  54. package/dist/components/common/SolidAdmin.js.map +1 -0
  55. package/dist/components/common/SolidFormStepper.d.ts.map +1 -1
  56. package/dist/components/common/SolidFormStepper.js +8 -1
  57. package/dist/components/common/SolidFormStepper.js.map +1 -1
  58. package/dist/components/common/SolidThemeLink.d.ts +2 -0
  59. package/dist/components/common/SolidThemeLink.d.ts.map +1 -0
  60. package/dist/components/common/SolidThemeLink.js +5 -0
  61. package/dist/components/common/SolidThemeLink.js.map +1 -0
  62. package/dist/components/common/error.d.ts +9 -0
  63. package/dist/components/common/error.d.ts.map +1 -0
  64. package/dist/components/common/error.js +7 -0
  65. package/dist/components/common/error.js.map +1 -0
  66. package/dist/components/core/common/FilterComponent.js +7 -7
  67. package/dist/components/core/common/FilterComponent.js.map +1 -1
  68. package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
  69. package/dist/components/core/common/SolidConfigureLayoutElement.js +4 -3
  70. package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
  71. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  72. package/dist/components/core/common/SolidGlobalSearchElement.js +38 -18
  73. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  74. package/dist/components/core/form/SolidFormLayouts.d.ts +3 -0
  75. package/dist/components/core/form/SolidFormLayouts.d.ts.map +1 -0
  76. package/dist/components/core/form/SolidFormLayouts.js +57 -0
  77. package/dist/components/core/form/SolidFormLayouts.js.map +1 -0
  78. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  79. package/dist/components/core/form/SolidFormView.js +13 -1
  80. package/dist/components/core/form/SolidFormView.js.map +1 -1
  81. package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
  82. package/dist/components/core/form/fields/SolidBooleanField.js +9 -7
  83. package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
  84. package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
  85. package/dist/components/core/form/fields/SolidDateField.js +7 -5
  86. package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
  87. package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
  88. package/dist/components/core/form/fields/SolidDateTimeField.js +7 -5
  89. package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
  90. package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
  91. package/dist/components/core/form/fields/SolidDecimalField.js +9 -7
  92. package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
  93. package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
  94. package/dist/components/core/form/fields/SolidIntegerField.js +9 -7
  95. package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
  96. package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
  97. package/dist/components/core/form/fields/SolidJsonField.js +6 -4
  98. package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
  99. package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
  100. package/dist/components/core/form/fields/SolidLongTextField.js +8 -6
  101. package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
  102. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  103. package/dist/components/core/form/fields/SolidMediaMultipleField.js +29 -23
  104. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  105. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  106. package/dist/components/core/form/fields/SolidMediaSingleField.js +22 -19
  107. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  108. package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
  109. package/dist/components/core/form/fields/SolidRichTextField.js +9 -7
  110. package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
  111. package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
  112. package/dist/components/core/form/fields/SolidSelectionDynamicField.js +10 -8
  113. package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
  114. package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
  115. package/dist/components/core/form/fields/SolidSelectionStaticField.js +10 -8
  116. package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
  117. package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
  118. package/dist/components/core/form/fields/SolidShortTextField.js +8 -6
  119. package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
  120. package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
  121. package/dist/components/core/form/fields/SolidTimeField.js +7 -5
  122. package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
  123. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
  124. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +16 -12
  125. package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
  126. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts +1 -0
  127. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.d.ts.map +1 -1
  128. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js +66 -7
  129. package/dist/components/core/form/fields/relations/SolidRelationManyToOneField.js.map +1 -1
  130. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
  131. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +12 -10
  132. package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
  133. package/dist/components/core/kanban/SolidKanbanView.js +2 -2
  134. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  135. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  136. package/dist/components/core/list/SolidListView.js +48 -62
  137. package/dist/components/core/list/SolidListView.js.map +1 -1
  138. package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
  139. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +9 -2
  140. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
  141. package/dist/components/core/list/columns/SolidMediaSingleColumn.d.ts.map +1 -1
  142. package/dist/components/core/list/columns/SolidMediaSingleColumn.js +10 -3
  143. package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
  144. package/dist/components/core/model/CreateModel.d.ts.map +1 -1
  145. package/dist/components/core/model/CreateModel.js +12 -1
  146. package/dist/components/core/model/CreateModel.js.map +1 -1
  147. package/dist/components/core/model/FieldMetaData.d.ts.map +1 -1
  148. package/dist/components/core/model/FieldMetaData.js +55 -2
  149. package/dist/components/core/model/FieldMetaData.js.map +1 -1
  150. package/dist/components/core/model/FieldMetaDataForm.d.ts +1 -1
  151. package/dist/components/core/model/FieldMetaDataForm.d.ts.map +1 -1
  152. package/dist/components/core/model/FieldMetaDataForm.js +128 -61
  153. package/dist/components/core/model/FieldMetaDataForm.js.map +1 -1
  154. package/dist/components/core/model/ModelMetaData.js +5 -5
  155. package/dist/components/core/module/CreateModule.d.ts.map +1 -1
  156. package/dist/components/core/module/CreateModule.js +7 -3
  157. package/dist/components/core/module/CreateModule.js.map +1 -1
  158. package/dist/components/core/users/CreateUser.js +2 -2
  159. package/dist/components/layout/AdminLayout.d.ts +4 -0
  160. package/dist/components/layout/AdminLayout.d.ts.map +1 -0
  161. package/dist/components/layout/AdminLayout.js +86 -0
  162. package/dist/components/layout/AdminLayout.js.map +1 -0
  163. package/dist/components/layout/AppConfig.d.ts.map +1 -1
  164. package/dist/components/layout/AppConfig.js +4 -9
  165. package/dist/components/layout/AppConfig.js.map +1 -1
  166. package/dist/components/layout/user-profile-menu.js +1 -1
  167. package/dist/components/layout/user-profile-menu.js.map +1 -1
  168. package/dist/index.d.ts +11 -0
  169. package/dist/index.d.ts.map +1 -1
  170. package/dist/index.js +12 -0
  171. package/dist/index.js.map +1 -1
  172. package/dist/nextAuth/authProviders.d.ts +4 -0
  173. package/dist/nextAuth/authProviders.d.ts.map +1 -0
  174. package/dist/nextAuth/authProviders.js +231 -0
  175. package/dist/nextAuth/authProviders.js.map +1 -0
  176. package/dist/nextAuth/refreshAccessToken.d.ts +2 -0
  177. package/dist/nextAuth/refreshAccessToken.d.ts.map +1 -0
  178. package/dist/nextAuth/refreshAccessToken.js +76 -0
  179. package/dist/nextAuth/refreshAccessToken.js.map +1 -0
  180. package/dist/redux/api/modelApi.d.ts +2 -1
  181. package/dist/redux/api/modelApi.d.ts.map +1 -1
  182. package/dist/redux/api/modelApi.js +9 -2
  183. package/dist/redux/api/modelApi.js.map +1 -1
  184. package/package.json +1 -1
  185. package/src/components/auth/AuthLayout.tsx +126 -0
  186. package/src/components/auth/ForgotPasswordThankYou.tsx +45 -0
  187. package/src/components/auth/GoogleAuthChecking.tsx +60 -0
  188. package/src/components/auth/SolidChangeForcePassword.tsx +21 -32
  189. package/src/components/auth/SolidForgotPassword.tsx +3 -2
  190. package/src/components/auth/SolidInitialLoginOtp.tsx +16 -8
  191. package/src/components/auth/SolidInitiateRegisterOtp.tsx +17 -9
  192. package/src/components/auth/SolidLogin.tsx +16 -10
  193. package/src/components/auth/SolidRegister.tsx +17 -9
  194. package/src/components/auth/SolidResetPassword.tsx +13 -6
  195. package/src/components/common/GeneralSettings.tsx +7 -2
  196. package/src/components/common/NotFound.tsx +22 -0
  197. package/src/components/common/SingleSelectAutoCompleteField.tsx +3 -1
  198. package/src/components/common/SocialMediaLogin.tsx +24 -25
  199. package/src/components/common/SolidAdmin.tsx +7 -0
  200. package/src/components/common/SolidFormStepper.tsx +55 -2
  201. package/src/components/common/SolidThemeLink.tsx +5 -0
  202. package/src/components/common/error.tsx +30 -0
  203. package/src/components/core/common/FilterComponent.tsx +70 -70
  204. package/src/components/core/common/SolidConfigureLayoutElement.tsx +6 -1
  205. package/src/components/core/common/SolidGlobalSearchElement.tsx +48 -20
  206. package/src/components/core/form/SolidFormLayouts.tsx +93 -0
  207. package/src/components/core/form/SolidFormView.tsx +64 -3
  208. package/src/components/core/form/fields/SolidBooleanField.tsx +6 -3
  209. package/src/components/core/form/fields/SolidDateField.tsx +6 -3
  210. package/src/components/core/form/fields/SolidDateTimeField.tsx +6 -3
  211. package/src/components/core/form/fields/SolidDecimalField.tsx +6 -3
  212. package/src/components/core/form/fields/SolidIntegerField.tsx +6 -3
  213. package/src/components/core/form/fields/SolidJsonField.tsx +6 -3
  214. package/src/components/core/form/fields/SolidLongTextField.tsx +6 -3
  215. package/src/components/core/form/fields/SolidMediaMultipleField.tsx +20 -12
  216. package/src/components/core/form/fields/SolidMediaSingleField.tsx +9 -6
  217. package/src/components/core/form/fields/SolidRichTextField.tsx +7 -3
  218. package/src/components/core/form/fields/SolidSelectionDynamicField.tsx +6 -3
  219. package/src/components/core/form/fields/SolidSelectionStaticField.tsx +6 -3
  220. package/src/components/core/form/fields/SolidShortTextField.tsx +8 -4
  221. package/src/components/core/form/fields/SolidTimeField.tsx +7 -4
  222. package/src/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +14 -8
  223. package/src/components/core/form/fields/relations/SolidRelationManyToOneField.tsx +93 -3
  224. package/src/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +5 -1
  225. package/src/components/core/kanban/SolidKanbanView.tsx +4 -4
  226. package/src/components/core/list/SolidListView.tsx +16 -64
  227. package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +18 -0
  228. package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +21 -0
  229. package/src/components/core/model/CreateModel.tsx +58 -0
  230. package/src/components/core/model/FieldMetaData.tsx +27 -1
  231. package/src/components/core/model/FieldMetaDataForm.tsx +134 -44
  232. package/src/components/core/model/ModelMetaData.tsx +5 -5
  233. package/src/components/core/module/CreateModule.tsx +12 -4
  234. package/src/components/core/users/CreateUser.tsx +2 -2
  235. package/src/components/layout/AdminLayout.tsx +62 -0
  236. package/src/components/layout/AppConfig.tsx +4 -3
  237. package/src/components/layout/user-profile-menu.tsx +1 -1
  238. package/src/index.ts +17 -1
  239. package/src/nextAuth/authProviders.tsx +220 -0
  240. package/src/nextAuth/refreshAccessToken.tsx +27 -0
  241. package/src/redux/api/modelApi.ts +9 -2
@@ -0,0 +1,60 @@
1
+ "use client"
2
+ import { signIn } from 'next-auth/react';
3
+ import { useRouter, useSearchParams } from 'next/navigation';
4
+ import { ProgressSpinner } from 'primereact/progressspinner';
5
+ import { Toast } from 'primereact/toast';
6
+ import React, { useEffect, useRef, useState } from 'react'
7
+ export const GoogleAuthChecking = () => {
8
+ const searchParams = useSearchParams();
9
+ const accessCode = searchParams.get("accessCode");
10
+
11
+ const router = useRouter();
12
+ const [error, setError] = useState<string | null>(null);
13
+ const toast = useRef<Toast>(null);
14
+ const showToast = (severity: "success" | "error", summary: string, detail: string) => {
15
+ toast.current?.show({
16
+ severity,
17
+ summary,
18
+ detail,
19
+ life: 3000,
20
+ });
21
+ };
22
+ useEffect(() => {
23
+ const handleOAuthAuthentication = async () => {
24
+ try {
25
+ const response = await signIn("credentials", {
26
+ redirect: false,
27
+ accessCode: accessCode
28
+ // accessToken: accessToken?.accessToken,
29
+ // refreshToken: accessToken?.refreshToken
30
+ });
31
+
32
+ if (response?.error) {
33
+ showToast("error", "Login Error", response.error);
34
+ setError("Authentication failed.")
35
+ } else {
36
+ showToast("success", "Login Success", "Redirecting to dashboard...");
37
+ router.push("/admin/core/solid-core/user/list");
38
+ }
39
+ } catch (err: any) {
40
+ showToast("error", "Login Error", err?.data?.message || "Authentication failed.");
41
+ }
42
+ };
43
+
44
+ handleOAuthAuthentication();
45
+ }, [router]);
46
+
47
+ if (error) {
48
+ return (
49
+ <div className="flex items-center justify-center min-h-screen">
50
+ <h2 className="text-red-500 text-xl font-semibold">{error}</h2>
51
+ </div>
52
+ );
53
+ }
54
+ return (
55
+ <div>
56
+ <Toast ref={toast} />
57
+ <ProgressSpinner />
58
+ </div>
59
+ )
60
+ }
@@ -39,24 +39,34 @@ const SolidChangeForcePassword = () => {
39
39
  id: session?.data?.user?.user?.id,
40
40
  },
41
41
  validationSchema,
42
- onSubmit: async (values) => {
42
+ onSubmit: async (values, { setErrors }) => {
43
43
  try {
44
44
  const payload = {
45
45
  id: values.id,
46
- email: values.email,
46
+ email: session?.data?.user?.user?.email,
47
47
  currentPassword: values.currentPassword,
48
48
  newPassword: values.newPassword,
49
49
  };
50
+ console.log("Payload:", payload);
51
+
50
52
  // Call the mutation and handle the response
51
53
  const response = await changePassword(payload).unwrap(); // Await the API call and unwrap to handle errors.
52
- if (response?.statusCode === 200) {
54
+ if (response?.error) {
55
+ showToast("error", "Error", response.error)
56
+ setErrors({
57
+ currentPassword: "Incorrect Current Password",
58
+ newPassword: "Passwords must match",
59
+ confirmPassword: "Passwords must match",
60
+ })
61
+ } else {
53
62
  showToast("success", "Force Password Change Success", "Password Change Successfully");
54
63
  signOut({ callbackUrl: "/auth/login" })
55
- } else (
56
- showToast("error", "Login Error", response.error)
57
- )
58
- } catch (err:any) {
64
+ }
65
+ } catch (err: any) {
59
66
  showToast("error", "Login Failed", err?.data?.message);
67
+ setErrors({
68
+ currentPassword: "Incorrect Current Password",
69
+ })
60
70
  }
61
71
  },
62
72
  });
@@ -68,31 +78,16 @@ const SolidChangeForcePassword = () => {
68
78
  <Toast ref={toast} />
69
79
 
70
80
  <form onSubmit={formik.handleSubmit} className='d-flex flex-column gap-3 auth-form'>
71
- <div className="flex flex-column gap-2 mt-2">
72
- <label htmlFor="email" className="solid-auth-input-label">Email Id</label>
73
- <InputText
74
- id="email"
75
- name="email"
76
- placeholder="Email ID"
77
- value={formik.values.email}
78
- onChange={formik.handleChange}
79
- onBlur={formik.handleBlur}
80
- readOnly
81
- />
82
- </div>
83
- <div className="flex flex-column gap-2 mt-4" style={{}}>
81
+ <div className="flex flex-column gap-2 mt-2" style={{}}>
84
82
  <label htmlFor="currentPassword" className="solid-auth-input-label">Current Password</label>
85
83
  <Password
86
84
  id="currentPassword"
87
85
  name="currentPassword"
88
- placeholder="***************"
89
86
  value={formik.values.currentPassword}
90
87
  onChange={formik.handleChange}
91
88
  onBlur={formik.handleBlur}
92
89
  toggleMask
93
- className={classNames("", {
94
- "p-invalid": isFormFieldValid(formik, "password"),
95
- })}
90
+ invalid={!!formik.errors.currentPassword}
96
91
  inputClassName="w-full"
97
92
  feedback={false}
98
93
  />
@@ -107,14 +102,11 @@ const SolidChangeForcePassword = () => {
107
102
  <Password
108
103
  id="newPassword"
109
104
  name="newPassword"
110
- placeholder="***************"
111
105
  value={formik.values.newPassword}
112
106
  onChange={formik.handleChange}
113
107
  onBlur={formik.handleBlur}
114
108
  toggleMask
115
- className={classNames("", {
116
- "p-invalid": isFormFieldValid(formik, "newPassword"),
117
- })}
109
+ invalid={!!formik.errors.newPassword}
118
110
  inputClassName="w-full"
119
111
  feedback={false}
120
112
  />
@@ -129,14 +121,11 @@ const SolidChangeForcePassword = () => {
129
121
  <Password
130
122
  id="confirmPassword"
131
123
  name="confirmPassword"
132
- placeholder="***************"
133
124
  value={formik.values.confirmPassword}
134
125
  onChange={formik.handleChange}
135
126
  onBlur={formik.handleBlur}
136
127
  toggleMask
137
- className={classNames("", {
138
- "p-invalid": isFormFieldValid(formik, "confirmPassword"),
139
- })}
128
+ invalid={!!formik.errors.confirmPassword}
140
129
  inputClassName="w-full"
141
130
  feedback={false}
142
131
  />
@@ -106,14 +106,15 @@ const SolidForgotPassword = () => {
106
106
  </div>
107
107
  <div className="mt-4">
108
108
  <Button className="w-full font-light auth-submit-button" label="Send OTP" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
109
+ <Button type="button" label="Back" className="w-full auth-back-button text-center" link onClick={() => (window.location.href = '/auth/login')} />
109
110
  </div>
110
111
  </form>
111
112
  </div>
112
- <div className="text-center mt-5">
113
+ {/* <div className="text-center mt-5">
113
114
  <div className="text-sm text-400 secondary-dark-color">
114
115
  {'<'} Back to <Link className="font-bold" href="/auth/login">Sign In</Link>
115
116
  </div>
116
- </div>
117
+ </div> */}
117
118
  </>
118
119
  );
119
120
  };
@@ -5,7 +5,7 @@ import { useConfirmOtpLoginMutation } from "@/redux/api/authApi";
5
5
  import { useLazyGetAuthSettingsQuery } from "@/redux/api/solidSettingsApi";
6
6
  import { Form, Formik } from "formik";
7
7
  import Link from "next/link";
8
- import { useRouter } from "next/navigation";
8
+ import { useRouter, useSearchParams } from "next/navigation";
9
9
  import { Button } from "primereact/button";
10
10
  import { InputOtp } from "primereact/inputotp";
11
11
  import { Message } from "primereact/message";
@@ -13,7 +13,10 @@ import { Toast } from "primereact/toast";
13
13
  import { useEffect, useRef } from "react";
14
14
  import * as Yup from "yup";
15
15
 
16
- const SolidInitialLoginOtp = ({ email }: { email: string }) => {
16
+ const SolidInitialLoginOtp = () => {
17
+ const searchParams = useSearchParams();
18
+ const tempEmail = searchParams.get('email');
19
+ const email = tempEmail ? decodeURIComponent(tempEmail) : '';
17
20
  const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
18
21
  useEffect(() => {
19
22
  trigger("")
@@ -67,7 +70,7 @@ const SolidInitialLoginOtp = ({ email }: { email: string }) => {
67
70
  otp: "",
68
71
  }}
69
72
  validationSchema={validationSchema}
70
- onSubmit={async (values, { setSubmitting }) => {
73
+ onSubmit={async (values, { setSubmitting, setErrors }) => {
71
74
  try {
72
75
  const payload = {
73
76
  type: "email",
@@ -81,7 +84,10 @@ const SolidInitialLoginOtp = ({ email }: { email: string }) => {
81
84
  showToast("success", "Login Successfully", "Login");
82
85
  router.push(`/admin/core/solid-core/user/list`);
83
86
  } else {
84
- showToast("error", "Login Error", response.error);
87
+ showToast("error", "Invalid OTP", response.error);
88
+ setErrors({
89
+ otp: "Invalid OTP",
90
+ });
85
91
  }
86
92
  } catch (err: any) {
87
93
  showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
@@ -92,13 +98,14 @@ const SolidInitialLoginOtp = ({ email }: { email: string }) => {
92
98
  >
93
99
  {(formik) => (
94
100
  <Form>
95
- <div className="flex flex-column gap-2 px-3">
101
+ <div className="flex flex-column gap-2">
96
102
  <label htmlFor="otp" className="solid-auth-input-label">Enter OTP</label>
97
103
  <InputOtp
98
104
  value={formik.values.otp}
99
105
  onChange={(e) => formik.setFieldValue("otp", e.value)}
100
106
  length={6}
101
107
  style={{ width: '100%' }}
108
+ invalid={!!formik.errors.otp}
102
109
  />
103
110
  {isFormFieldValid(formik, "otp") && (
104
111
  <Message className="text-red-500 text-sm" severity="error" text={formik.errors.otp?.toString()} />
@@ -112,17 +119,18 @@ const SolidInitialLoginOtp = ({ email }: { email: string }) => {
112
119
  </div>
113
120
  <div className="mt-4">
114
121
  <Button type="submit" className="w-full font-light auth-submit-button" label="Verify" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
122
+ <Button type="button" label="Back" className="w-full auth-back-button text-center" link onClick={() => (window.location.href = '/auth/login')} />
115
123
  </div>
116
124
  </Form>
117
125
  )}
118
126
  </Formik>
119
127
  </>
120
128
  </div>
121
- <div className="text-center mt-5">
129
+ {/* <div className="text-center mt-5">
122
130
  <div className="text-sm text-400 secondary-dark-color">
123
- {'<'} Back to <Link className="font-bold" href="/auth/login">Sign In</Link>
131
+ {'<'} Back to <Link className="font-bold" href="/auth/login">Back</Link>
124
132
  </div>
125
- </div>
133
+ </div> */}
126
134
  </>
127
135
  );
128
136
  };
@@ -5,7 +5,7 @@ import { useConfirmOtpRegisterMutation } from "@/redux/api/authApi";
5
5
  import { useLazyGetAuthSettingsQuery } from "@/redux/api/solidSettingsApi";
6
6
  import { Form, Formik } from "formik";
7
7
  import Link from "next/link";
8
- import { useRouter } from "next/navigation";
8
+ import { useRouter, useSearchParams } from "next/navigation";
9
9
  import { Button } from "primereact/button";
10
10
  import { InputOtp } from "primereact/inputotp";
11
11
  import { Message } from "primereact/message";
@@ -13,7 +13,10 @@ import { Toast } from "primereact/toast";
13
13
  import { useEffect, useRef } from "react";
14
14
  import * as Yup from "yup";
15
15
 
16
- const SolidInitiateRegisterOtp = ({ email }: { email: string }) => {
16
+ const SolidInitiateRegisterOtp = () => {
17
+ const searchParams = useSearchParams();
18
+ const tempEmail = searchParams.get('email');
19
+ const email = tempEmail ? decodeURIComponent(tempEmail) : '';
17
20
  const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
18
21
  useEffect(() => {
19
22
  trigger("")
@@ -67,7 +70,7 @@ const SolidInitiateRegisterOtp = ({ email }: { email: string }) => {
67
70
  otp: "",
68
71
  }}
69
72
  validationSchema={validationSchema}
70
- onSubmit={async (values, { setSubmitting }) => {
73
+ onSubmit={async (values, { setSubmitting, setErrors }) => {
71
74
  try {
72
75
  const payload = {
73
76
  type: "email",
@@ -81,7 +84,10 @@ const SolidInitiateRegisterOtp = ({ email }: { email: string }) => {
81
84
  showToast("success", "Login Successfully", "Login");
82
85
  router.push(`/auth/login`);
83
86
  } else {
84
- showToast("error", "Login Error", response.error);
87
+ showToast("error", "Invalid OTP", response.error);
88
+ setErrors({
89
+ otp: "Invalid OTP",
90
+ });
85
91
  }
86
92
  } catch (err: any) {
87
93
  showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
@@ -92,13 +98,14 @@ const SolidInitiateRegisterOtp = ({ email }: { email: string }) => {
92
98
  >
93
99
  {(formik) => (
94
100
  <Form>
95
- <div className="flex flex-column gap-2 px-3">
101
+ <div className="flex flex-column gap-2">
96
102
  <label htmlFor="otp" className="solid-auth-input-label">Enter OTP</label>
97
103
  <InputOtp
98
104
  value={formik.values.otp}
99
105
  onChange={(e) => formik.setFieldValue("otp", e.value)}
100
106
  length={6}
101
107
  style={{ width: '100%' }}
108
+ invalid={!!formik.errors.otp}
102
109
  />
103
110
  {isFormFieldValid(formik, "otp") && (
104
111
  <Message className="text-red-500 text-sm" severity="error" text={formik.errors.otp?.toString()} />
@@ -112,17 +119,18 @@ const SolidInitiateRegisterOtp = ({ email }: { email: string }) => {
112
119
  </div>
113
120
  <div className="mt-4">
114
121
  <Button type="submit" className="w-full font-light auth-submit-button" label="Verify" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
122
+ <Button type="button" label="Back" className="w-full auth-back-button text-center" link onClick={() => (window.location.href = '/auth/login')} />
115
123
  </div>
116
124
  </Form>
117
125
  )}
118
126
  </Formik>
119
127
  </>
120
128
  </div>
121
- <div className="text-center mt-5">
122
- <div className="text-sm text-400 secondary-dark-color">
123
- {'<'} Back to <Link className="font-bold" href="/auth/login">Sign In</Link>
124
- </div>
129
+ {/* <div className="text-center mt-5">
130
+ <div className="text-sm text-400 secondary-dark-color">
131
+ {'<'} Back to <Link className="font-bold" href="/auth/login">Sign In</Link>
125
132
  </div>
133
+ </div> */}
126
134
  </>
127
135
  );
128
136
  };
@@ -76,7 +76,7 @@ const SolidLogin = () => {
76
76
  .required("Email is required"),
77
77
  password: Yup.string().required("Password is required"),
78
78
  })}
79
- onSubmit={async (values, { setSubmitting }) => {
79
+ onSubmit={async (values, { setSubmitting, setErrors }) => {
80
80
  try {
81
81
  const response = await signIn("credentials", {
82
82
  redirect: false,
@@ -86,6 +86,10 @@ const SolidLogin = () => {
86
86
 
87
87
  if (response?.error) {
88
88
  showToast("error", "Login Error", response.error);
89
+ setErrors({
90
+ email: "Invalid email or password",
91
+ password: "Invalid email or password",
92
+ });
89
93
  } else {
90
94
  showToast("success", "Login Success", "Redirecting to dashboard...");
91
95
  router.push("/admin/core/solid-core/user/list");
@@ -107,6 +111,7 @@ const SolidLogin = () => {
107
111
  placeholder="Email ID"
108
112
  onChange={formik.handleChange}
109
113
  value={formik.values.email}
114
+ invalid={!!formik.errors.email}
110
115
  />
111
116
  {isFormFieldValid(formik, "email") && <Message
112
117
  className="text-red-500 text-sm"
@@ -114,20 +119,17 @@ const SolidLogin = () => {
114
119
  text={formik?.errors?.email?.toString()}
115
120
  />}
116
121
  </div>
117
- <div className="flex flex-column gap-2 mt-4" style={{}}>
122
+ <div className="flex flex-column gap-1 mt-4" style={{}}>
118
123
  <label htmlFor="password" className="solid-auth-input-label">Password</label>
119
124
  <Password
120
125
  id="password"
121
- placeholder="***************"
122
126
  value={password}
123
127
  onChange={(e) => {
124
128
  setPassword(e.target.value);
125
129
  formik.setFieldValue("password", e.target.value);
126
130
  }}
127
131
  toggleMask
128
- className={classNames("", {
129
- "p-invalid": isFormFieldValid(formik, "password"),
130
- })}
132
+ invalid={!!formik.errors.password}
131
133
  inputClassName="w-full"
132
134
  feedback={false}
133
135
  />
@@ -138,9 +140,9 @@ const SolidLogin = () => {
138
140
  />}
139
141
  </div>
140
142
  {/* <div className="flex align-items-center mt-4">
141
- <Checkbox inputId="remember" onChange={(e: any) => setChecked(e.checked)} checked={checked} />
142
- <label htmlFor="remember" className="ml-2">Remember me</label>
143
- </div> */}
143
+ <Checkbox inputId="remember" onChange={(e: any) => setChecked(e.checked)} checked={checked} />
144
+ <label htmlFor="remember" className="ml-2">Remember me</label>
145
+ </div> */}
144
146
  <div className="mt-4 text-right">
145
147
  <Link href={"/auth/initiate-forgot-password"} className="solid-auth-input-label">Forgot Password?</Link>
146
148
  </div>
@@ -160,7 +162,7 @@ const SolidLogin = () => {
160
162
  email: Yup.string()
161
163
  .email("Invalid email address")
162
164
  })}
163
- onSubmit={async (values, { setSubmitting }) => {
165
+ onSubmit={async (values, { setSubmitting, setErrors }) => {
164
166
  try {
165
167
  const payload = {
166
168
  type: "email",
@@ -178,6 +180,9 @@ const SolidLogin = () => {
178
180
  }
179
181
  } catch (err: any) {
180
182
  showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
183
+ setErrors({
184
+ email: "Invalid email",
185
+ });
181
186
  } finally {
182
187
  setSubmitting(false);
183
188
  }
@@ -193,6 +198,7 @@ const SolidLogin = () => {
193
198
  placeholder="Email ID"
194
199
  onChange={formik.handleChange}
195
200
  value={formik.values.email}
201
+ invalid={!!formik.errors.email}
196
202
  />
197
203
  {isFormFieldValid(formik, "email") && <Message
198
204
  className="text-red-500 text-sm"
@@ -102,7 +102,7 @@ const SolidRegister = () => {
102
102
  .required("Email is required"),
103
103
  password: Yup.string().required("Password is required"),
104
104
  })}
105
- onSubmit={async (values, { setSubmitting }) => {
105
+ onSubmit={async (values, { setSubmitting, setErrors }) => {
106
106
  try {
107
107
  const userData = {
108
108
  username: values.username,
@@ -113,12 +113,19 @@ const SolidRegister = () => {
113
113
  const response = await register(userData).unwrap();
114
114
  if (response?.statusCode === 200) {
115
115
  showToast("success", "User Registered", response?.data?.message);
116
- router.push(`/auth/login`);
116
+ setTimeout(() => {
117
+ router.push(`/auth/login`);
118
+ }, 3000);
117
119
  } else {
118
120
  showToast("error", "Login Error", response.error);
121
+ // setErrors({
122
+ // username: 'Invalid email or password',
123
+ // email: "Invalid email or password",
124
+ // password: "Invalid email or password",
125
+ // });
119
126
  }
120
127
  } catch (err: any) {
121
- showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
128
+ showToast("error", "Login Conflict", err?.data ? err?.data?.message : "Something Went Wrong");
122
129
  } finally {
123
130
  setSubmitting(false);
124
131
  }
@@ -134,6 +141,7 @@ const SolidRegister = () => {
134
141
  placeholder="username"
135
142
  onChange={formik.handleChange}
136
143
  value={formik.values.username}
144
+ invalid={!!formik.errors.username}
137
145
  />
138
146
  {isFormFieldValid(formik, "username") && <Message
139
147
  className="text-red-500 text-sm"
@@ -149,6 +157,7 @@ const SolidRegister = () => {
149
157
  placeholder="Yourgmail@123.com"
150
158
  onChange={formik.handleChange}
151
159
  value={formik.values.email}
160
+ invalid={!!formik.errors.email}
152
161
  />
153
162
  {isFormFieldValid(formik, "email") && <Message
154
163
  className="text-red-500 text-sm"
@@ -163,13 +172,10 @@ const SolidRegister = () => {
163
172
  name="password"
164
173
  value={formik.values.password}
165
174
  onChange={formik.handleChange}
166
- placeholder="***************"
167
175
  toggleMask
168
- className={classNames("", {
169
- "p-invalid": isFormFieldValid(formik, "password"),
170
- })}
171
176
  inputClassName="w-full"
172
177
  feedback={false}
178
+ invalid={!!formik.errors.password}
173
179
  />
174
180
  {isFormFieldValid(formik, "password") && <Message
175
181
  className="text-red-500 text-sm"
@@ -233,6 +239,7 @@ const SolidRegister = () => {
233
239
  placeholder="username"
234
240
  onChange={formik.handleChange}
235
241
  value={formik.values.username}
242
+ invalid={!!formik.errors.username}
236
243
  />
237
244
  {isFormFieldValid(formik, "username") && <Message
238
245
  className="text-red-500 text-sm"
@@ -248,6 +255,7 @@ const SolidRegister = () => {
248
255
  placeholder="Yourgmail@123.com"
249
256
  onChange={formik.handleChange}
250
257
  value={formik.values.email}
258
+ invalid={!!formik.errors.email}
251
259
  />
252
260
  {isFormFieldValid(formik, "email") && <Message
253
261
  className="text-red-500 text-sm"
@@ -264,7 +272,7 @@ const SolidRegister = () => {
264
272
  )
265
273
  }
266
274
 
267
- const AuthTabs: React.FC<AuthTabsProps> = ({iamPasswordRegistrationEnabled, iamPasswordLessRegistrationEnabled}) => {
275
+ const AuthTabs: React.FC<AuthTabsProps> = ({ iamPasswordRegistrationEnabled, iamPasswordLessRegistrationEnabled }) => {
268
276
  if (iamPasswordRegistrationEnabled && iamPasswordLessRegistrationEnabled) {
269
277
  return (
270
278
  <TabView className="solid-auth-tabview">
@@ -300,7 +308,7 @@ const SolidRegister = () => {
300
308
  </div>
301
309
  </div>
302
310
  }
303
- <h2 className={`solid-auth-title ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`}>Sign Up To Your Account</h2>
311
+ <h2 className={`solid-auth-title ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'text-center' : 'text-left'}`}>Sign Up</h2>
304
312
  {/* <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> */}
305
313
  <AuthTabs iamPasswordRegistrationEnabled={solidSettingsData?.data?.iamPasswordRegistrationEnabled} iamPasswordLessRegistrationEnabled={solidSettingsData?.data?.iamPasswordLessRegistrationEnabled} />
306
314
  {solidSettingsData?.data?.iamGoogleOAuthEnabled &&
@@ -5,7 +5,7 @@ import { useConfirmForgotPasswordMutation } from "@/redux/api/authApi";
5
5
  import { useLazyGetAuthSettingsQuery } from "@/redux/api/solidSettingsApi";
6
6
  import { useFormik } from "formik";
7
7
  import Link from "next/link";
8
- import { useRouter } from "next/navigation";
8
+ import { useRouter, useSearchParams } from "next/navigation";
9
9
  import { Button } from "primereact/button";
10
10
  import { Message } from "primereact/message";
11
11
  import { Password } from "primereact/password";
@@ -14,7 +14,11 @@ import { classNames } from "primereact/utils";
14
14
  import { useEffect, useRef } from "react";
15
15
  import * as Yup from "yup";
16
16
 
17
- const SolidResetPassword = ({ verificationToken, username }: { verificationToken?: any, username?: any }) => {
17
+ const SolidResetPassword = () => {
18
+ const searchParams = useSearchParams();
19
+ const verificationToken = searchParams.get('token');
20
+ const decodedUsername = searchParams.get('username');
21
+ const username = decodedUsername ? decodeURIComponent(decodedUsername) : '';
18
22
  const [trigger, { data: solidSettingsData }] = useLazyGetAuthSettingsQuery();
19
23
  useEffect(() => {
20
24
  trigger("")
@@ -52,6 +56,7 @@ const SolidResetPassword = ({ verificationToken, username }: { verificationToken
52
56
  password: values.password,
53
57
  verificationToken: values.verificationToken,
54
58
  };
59
+ console.log("Paylod", payload);
55
60
  const response = await confirmForgotPassword(payload).unwrap();
56
61
  if (response?.statusCode === 200) {
57
62
  showToast("success", "Login Successfull", "Password Updated Successfully")
@@ -60,6 +65,7 @@ const SolidResetPassword = ({ verificationToken, username }: { verificationToken
60
65
  showToast("error", "Login Error", response.error)
61
66
  )
62
67
  } catch (err: any) {
68
+ console.log("Error", err);
63
69
  showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
64
70
  }
65
71
  },
@@ -71,7 +77,7 @@ const SolidResetPassword = ({ verificationToken, username }: { verificationToken
71
77
  return (
72
78
  <>
73
79
  <Toast ref={toast} />
74
- <div className={`auth-container ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'center' : 'side'}`}>
80
+ <div className={`auth-container ${solidSettingsData?.data?.authPagesLayout === 'center' ? 'center' : 'side'}`}>
75
81
  {solidSettingsData?.data?.authPagesLayout === 'center' &&
76
82
  <div className="flex justify-content-center">
77
83
  <div className="solid-logo flex align-items-center gap-3">
@@ -109,7 +115,7 @@ const SolidResetPassword = ({ verificationToken, username }: { verificationToken
109
115
  text={formik?.errors?.password?.toString()}
110
116
  />}
111
117
  </div>
112
- <div className="flex flex-column gap-2 mt-4" style={{}}>
118
+ <div className="flex flex-column gap-1 mt-4" style={{}}>
113
119
  <label htmlFor="password" className="solid-auth-input-label">Confirm Password</label>
114
120
  <Password
115
121
  id="confirmPassword"
@@ -137,14 +143,15 @@ const SolidResetPassword = ({ verificationToken, username }: { verificationToken
137
143
  </div> */}
138
144
  <div className="mt-4">
139
145
  <Button className="w-full font-light auth-submit-button" label="Reset Password" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
146
+ <Button type="button" label="Back" className="w-full auth-back-button text-center" link onClick={() => (window.location.href = '/auth/login')} />
140
147
  </div>
141
148
  </form>
142
149
  </div>
143
- <div className="text-center mt-5">
150
+ {/* <div className="text-center mt-5">
144
151
  <div className="text-sm text-400 secondary-dark-color">
145
152
  {'<'} Back to <Link className="font-bold" href="/auth/login">Sign In</Link>
146
153
  </div>
147
- </div>
154
+ </div> */}
148
155
  </>
149
156
  );
150
157
  };
@@ -1,5 +1,5 @@
1
1
  "use client"
2
- import { useCreateSolidSettingsMutation, useUpdateSolidSettingsMutation } from '@/redux/api/solidSettingsApi';
2
+ import { useCreateSolidSettingsMutation, useLazyGetSolidSettingsQuery, useUpdateSolidSettingsMutation } from '@/redux/api/solidSettingsApi';
3
3
  import { useFormik } from 'formik';
4
4
  import { Button } from 'primereact/button';
5
5
  import { InputText } from 'primereact/inputtext';
@@ -11,7 +11,12 @@ import { RadioButton } from 'primereact/radiobutton';
11
11
  import { handleError } from '@/helpers/ToastContainer';
12
12
  import { usePathname } from 'next/navigation';
13
13
 
14
- export const GeneralSettings = ({ solidSettingsData }: { solidSettingsData: any }) => {
14
+ export const GeneralSettings = () => {
15
+ const [trigger, { data: solidSettingsData }] = useLazyGetSolidSettingsQuery()
16
+
17
+ useEffect(() => {
18
+ trigger("") // Fetch settings on mount
19
+ }, [trigger])
15
20
  const pathname = usePathname();
16
21
  const [updateSolidSettings] = useUpdateSolidSettingsMutation();
17
22
  const [