next-auth-mfelfelani72 0.0.15 → 0.0.16

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.
@@ -38,7 +38,7 @@ export interface ClientRegisterInterface {
38
38
  name?: string;
39
39
  email?: string;
40
40
  password?: string;
41
- confirmPassword?: string;
41
+ password_confirmation?: string;
42
42
  };
43
43
  message: string | null;
44
44
  loading?: boolean;
@@ -22,7 +22,7 @@ export default function Register({ registerRoute, onGoogleRegister, UiComponent,
22
22
  const name = formData.get("name") || "";
23
23
  const email = formData.get("email") || "";
24
24
  const password = formData.get("password") || "";
25
- const confirmPassword = formData.get("confirmPassword") || "";
25
+ const password_confirmation = formData.get("password_confirmation") || "";
26
26
  const newErrors = {};
27
27
  if (!name.trim())
28
28
  newErrors.name = "Name is required";
@@ -36,10 +36,10 @@ export default function Register({ registerRoute, onGoogleRegister, UiComponent,
36
36
  newErrors.password = "Password is required";
37
37
  else if (password.length < 6)
38
38
  newErrors.password = "Password must be at least 6 characters";
39
- if (!confirmPassword)
40
- newErrors.confirmPassword = "Please confirm your password";
41
- else if (password !== confirmPassword)
42
- newErrors.confirmPassword = "Passwords do not match";
39
+ if (!password_confirmation)
40
+ newErrors.password_confirmation = "Please confirm your password";
41
+ else if (password !== password_confirmation)
42
+ newErrors.password_confirmation = "Passwords do not match";
43
43
  if (Object.keys(newErrors).length > 0) {
44
44
  setErrors(newErrors);
45
45
  setMessage("Please fix the errors below.");
@@ -54,7 +54,7 @@ export default function Register({ registerRoute, onGoogleRegister, UiComponent,
54
54
  name,
55
55
  email,
56
56
  password,
57
- password_confirmation: confirmPassword,
57
+ password_confirmation,
58
58
  }),
59
59
  });
60
60
  const data = await res.json();
@@ -30,7 +30,7 @@ export default function UiRegister({ onSubmit, errors, message, dict, lang, }) {
30
30
  ? "border-red-500"
31
31
  : "border-gray-300 focus:ring-purple-400"}` }), (errors === null || errors === void 0 ? void 0 : errors.email) && (_jsx("p", { className: "mt-1 text-sm text-red-300", children: errors.email }))] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "password", className: "block text-sm font-medium text-white mb-1", children: "Password" }), _jsx("input", { id: "password", name: "password", type: "password", placeholder: "Enter your password", required: true, className: `w-full px-4 py-2 rounded-lg bg-white/20 focus:bg-white/30 border focus:outline-none focus:ring-2 text-white placeholder-gray-200 ${(errors === null || errors === void 0 ? void 0 : errors.password)
32
32
  ? "border-red-500"
33
- : "border-gray-300 focus:ring-purple-400"}` }), (errors === null || errors === void 0 ? void 0 : errors.password) && (_jsx("p", { className: "mt-1 text-sm text-red-300", children: errors.password }))] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "confirmPassword", className: "block text-sm font-medium text-white mb-1", children: "Confirm Password" }), _jsx("input", { id: "confirmPassword", name: "confirmPassword", type: "password", placeholder: "Confirm your password", required: true, className: `w-full px-4 py-2 rounded-lg bg-white/20 focus:bg-white/30 border focus:outline-none focus:ring-2 text-white placeholder-gray-200 ${(errors === null || errors === void 0 ? void 0 : errors.confirmPassword)
33
+ : "border-gray-300 focus:ring-purple-400"}` }), (errors === null || errors === void 0 ? void 0 : errors.password) && (_jsx("p", { className: "mt-1 text-sm text-red-300", children: errors.password }))] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "password_confirmation", className: "block text-sm font-medium text-white mb-1", children: "Confirm Password" }), _jsx("input", { id: "password_confirmation", name: "password_confirmation", type: "password", placeholder: "Confirm your password", required: true, className: `w-full px-4 py-2 rounded-lg bg-white/20 focus:bg-white/30 border focus:outline-none focus:ring-2 text-white placeholder-gray-200 ${(errors === null || errors === void 0 ? void 0 : errors.password_confirmation)
34
34
  ? "border-red-500"
35
- : "border-gray-300 focus:ring-purple-400"}` }), (errors === null || errors === void 0 ? void 0 : errors.confirmPassword) && (_jsx("p", { className: "mt-1 text-sm text-red-300", children: errors.confirmPassword }))] }), _jsx("button", { type: "submit", className: "w-full py-2 bg-purple-700/80 text-white rounded-lg hover:bg-purple-800 transition", children: "Sign Up" }), _jsxs("div", { className: "flex justify-center gap-4 mt-4", children: [_jsx("button", { type: "button", className: "flex items-center justify-center w-10 h-10 rounded-full bg-red-500 hover:bg-red-600 text-white transition font-bold text-lg", children: "G" }), _jsx("button", { type: "button", className: "flex items-center justify-center w-10 h-10 rounded-full bg-blue-600 hover:bg-blue-700 text-white transition font-bold text-lg", children: "F" }), _jsx("button", { type: "button", className: "flex items-center justify-center w-10 h-10 rounded-full bg-blue-400 hover:bg-blue-500 text-white transition font-bold text-lg", children: "T" })] }), _jsxs("p", { className: "text-center text-sm text-gray-200 mt-4", children: ["Already have an account?", " ", _jsx(Link, { href: `/${lang}/login`, className: "underline hover:text-white", scroll: false, children: "Login" })] })] })] }) }));
35
+ : "border-gray-300 focus:ring-purple-400"}` }), (errors === null || errors === void 0 ? void 0 : errors.password_confirmation) && (_jsx("p", { className: "mt-1 text-sm text-red-300", children: errors.password_confirmation }))] }), _jsx("button", { type: "submit", className: "w-full py-2 bg-purple-700/80 text-white rounded-lg hover:bg-purple-800 transition", children: "Sign Up" }), _jsxs("div", { className: "flex justify-center gap-4 mt-4", children: [_jsx("button", { type: "button", className: "flex items-center justify-center w-10 h-10 rounded-full bg-red-500 hover:bg-red-600 text-white transition font-bold text-lg", children: "G" }), _jsx("button", { type: "button", className: "flex items-center justify-center w-10 h-10 rounded-full bg-blue-600 hover:bg-blue-700 text-white transition font-bold text-lg", children: "F" }), _jsx("button", { type: "button", className: "flex items-center justify-center w-10 h-10 rounded-full bg-blue-400 hover:bg-blue-500 text-white transition font-bold text-lg", children: "T" })] }), _jsxs("p", { className: "text-center text-sm text-gray-200 mt-4", children: ["Already have an account?", " ", _jsx(Link, { href: `/${lang}/login`, className: "underline hover:text-white", scroll: false, children: "Login" })] })] })] }) }));
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-auth-mfelfelani72",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [