From 20caf401ae4b6248d40da266a86e74ad2e539f7b Mon Sep 17 00:00:00 2001 From: sayaliparab Date: Mon, 10 Jun 2024 14:46:36 +0530 Subject: [PATCH 1/2] resetPass --- public/assets/css/light/main.css | 2 +- public/assets/js/admin/auth/login.js | 144 ++++++----- .../Admin/pages/auth/password_reset.blade.php | 244 ++++++++---------- .../components/confirms-password.blade.php | 4 +- 4 files changed, 185 insertions(+), 209 deletions(-) diff --git a/public/assets/css/light/main.css b/public/assets/css/light/main.css index 0a32411..782f552 100644 --- a/public/assets/css/light/main.css +++ b/public/assets/css/light/main.css @@ -536,7 +536,7 @@ input[type=search]::-ms-reveal { /* Form Group Label */ .form-group label, label { font-size: 15px; - color: #0e1726; + color: #f3342f; letter-spacing: 1px; display: inline-block; margin-bottom: 0.5rem; diff --git a/public/assets/js/admin/auth/login.js b/public/assets/js/admin/auth/login.js index 31cbbc2..c54903c 100644 --- a/public/assets/js/admin/auth/login.js +++ b/public/assets/js/admin/auth/login.js @@ -1,13 +1,13 @@ // Login js $(document).on("click", "#admin_login_btn", function (e) { - $('#admin_login_form').validate({ + $("#admin_login_form").validate({ rules: { email: { required: true, }, password: { required: true, - } + }, }, messages: { email: { @@ -15,7 +15,7 @@ $(document).on("click", "#admin_login_btn", function (e) { }, password: { required: "Please enter the password.", - } + }, }, submitHandler: function (form) { e.preventDefault(); @@ -23,64 +23,68 @@ $(document).on("click", "#admin_login_btn", function (e) { var formData = new FormData(form); $.ajaxSetup({ headers: { - "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), + "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr( + "content" + ), }, }); $.ajax({ - url: base_url + '/check_login', - type: 'POST', + url: base_url + "/check_login", + type: "POST", data: formData, - beforeSend:function(){ - $('#admin_login_btn').text('Please wait...'); - $('#admin_login_btn').attr('disabled', true); + beforeSend: function () { + $("#admin_login_btn").text("Please wait..."); + $("#admin_login_btn").attr("disabled", true); }, processData: false, contentType: false, success: function (response) { if (response.status == 200) { - $('#admin_login_btn').prop('disabled', false); - $('#admin_login_btn').text('Login'); + $("#admin_login_btn").prop("disabled", false); + $("#admin_login_btn").text("Login"); window.location.href = base_url + "/dashboard"; - } + } if (response.status == 401) { toastr.error(response.message); form.reset(); - $('#admin_login_btn').prop('disabled', false); - $('#admin_login_btn').text('Sign In'); + $("#admin_login_btn").prop("disabled", false); + $("#admin_login_btn").text("Sign In"); } }, }); - } + }, }); }); // forgot password js $(document).on("click", "#forgot_password_btn", function (e) { let base_url = url_path; - $('#forgot_pass_form').validate({ + $("#forgot_pass_form").validate({ ignore: [], debug: false, rules: { email: { - required: true - } + required: true, + }, }, messages: { email: { - required: "Please Enter email" - } + required: "Please Enter email", + }, }, submitHandler: function (form) { var formData = new FormData(form); e.preventDefault(), - $.ajaxSetup({ - headers: { - "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), - }, - }); + $.ajaxSetup({ + headers: { + "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr( + "content" + ), + }, + }); $.ajax({ - url: base_url + '/send_otp', - type: 'POST', + url: base_url + "/send_otp", + type: "POST", data: formData, processData: false, contentType: false, @@ -88,51 +92,53 @@ $(document).on("click", "#forgot_password_btn", function (e) { console.log(response); if (response.status == 200) { form.reset(); - toastr.success('Otp send it your mail id please check'); + toastr.success("Otp send it your mail id please check"); setTimeout(function () { -// toastr.info('Please check your email to reset your password. The link is valid for 5 minutes.'); + // toastr.info('Please check your email to reset your password. The link is valid for 5 minutes.'); window.location.href = base_url + "/otp"; }, 1000); - }else if (response.status == 404) { - toastr.error('This email id is not exits'); - } - else { + } else if (response.status == 404) { + toastr.error("This email id is not exits"); + } else { toastr.error("Something went wrong"); } }, }); - } + }, }); }); // otp varification -$(document).on('click', '#otp_verify_button', function(e) { +$(document).on("click", "#otp_verify_button", function (e) { e.preventDefault(); // Get base URL let base_url = url_path; // Get admin ID - var id = $('#admin_otp_id').val(); + var id = $("#admin_otp_id").val(); // Get OTP by concatenating values of all OTP input fields - var otp = $('.otp').map(function() { - return this.value; - }).get().join(''); + var otp = $(".otp") + .map(function () { + return this.value; + }) + .get() + .join(""); // Send AJAX request for OTP verification $.ajax({ - url: base_url + '/otp_verify', - type: 'POST', + url: base_url + "/otp_verify", + type: "POST", data: { id: id, otp: otp, - '_token': $('meta[name="csrf-token"]').attr('content') + _token: $('meta[name="csrf-token"]').attr("content"), }, success: function (response) { if (response.status == 200) { // Display success message - toastr.success('Otp Verify Successfully'); + toastr.success("Otp Verify Successfully"); // Redirect to the dashboard after a delay setTimeout(function () { window.location.href = base_url + "/password_reset"; @@ -148,34 +154,35 @@ $(document).on('click', '#otp_verify_button', function(e) { }); }); - -$(document).on('input', '.otp', function() { - this.value = this.value.replace(/[^0-9]/g, ''); +$(document).on("input", ".otp", function () { + this.value = this.value.replace(/[^0-9]/g, ""); if (this.value.length >= this.maxLength) { - $(this).next('.otp').focus(); + $(this).next(".otp").focus(); } }); // Reset Password $(document).on("click", "#password_reset", function (e) { - $('#password_reset_form').validate({ + $("#password_reset_form").validate({ rules: { password: { required: true, + minlength: 8, }, confirm_password: { required: true, - equalTo: "#password" + equalTo: "#password", }, }, messages: { password: { required: "Please enter a password.", + minlength: "The password field must be at least 8 characters.", }, confirm_password: { required: "Please Confirm Your Password", - equalTo: "Your Password Do Not Match" + equalTo: "Your Password Do Not Match", }, }, submitHandler: function (form) { @@ -185,43 +192,44 @@ $(document).on("click", "#password_reset", function (e) { $.ajaxSetup({ headers: { - "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), + "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr( + "content" + ), }, }); $.ajax({ - url: base_url + '/password_update', - type: 'POST', + url: base_url + "/password_update", + type: "POST", data: formData, processData: false, contentType: false, success: function (response) { if (response.status == 200) { - $('#password_reset').prop('disabled', false); - $('#password_reset').text('Login'); + $("#password_reset").prop("disabled", false); + $("#password_reset").text("Login"); window.location.href = base_url + "/"; - } + } if (response.status == 401) { toastr.error(response.message); form.reset(); - $('#password_reset').prop('disabled', false); - $('#password_reset').text('Sign In'); + $("#password_reset").prop("disabled", false); + $("#password_reset").text("Sign In"); } }, }); - } + }, }); }); -$('#passwordToggle').click(function () { - var passwordInput = $('#password'); - var eyeIcon = $('#passwordToggle'); +$("#passwordToggle").click(function () { + var passwordInput = $("#password"); + var eyeIcon = $("#passwordToggle"); - if (passwordInput.attr('type') === 'password') { - passwordInput.attr('type', 'text'); - eyeIcon.removeClass('fa-eye-slash').addClass('fa-eye'); + if (passwordInput.attr("type") === "password") { + passwordInput.attr("type", "text"); + eyeIcon.removeClass("fa-eye-slash").addClass("fa-eye"); } else { - passwordInput.attr('type', 'password'); - eyeIcon.removeClass('fa-eye').addClass('fa-eye-slash'); + passwordInput.attr("type", "password"); + eyeIcon.removeClass("fa-eye").addClass("fa-eye-slash"); } }); - diff --git a/resources/views/Admin/pages/auth/password_reset.blade.php b/resources/views/Admin/pages/auth/password_reset.blade.php index 0db192b..de8d6c3 100644 --- a/resources/views/Admin/pages/auth/password_reset.blade.php +++ b/resources/views/Admin/pages/auth/password_reset.blade.php @@ -2,41 +2,53 @@ @section('title', 'Cheers To Season - Password Reset') @section('content') -
-
-
- +
+
+
+ +
-
-
-
@endsection @section('scripts') - - + + + + - - -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/components/confirms-password.blade.php b/resources/views/components/confirms-password.blade.php index 6be56db..44b4f21 100644 --- a/resources/views/components/confirms-password.blade.php +++ b/resources/views/components/confirms-password.blade.php @@ -1,4 +1,4 @@ -@props(['title' => __('Confirm Password'), 'content' => __('For your security, please confirm your password to continue.'), 'button' => __('Confirm')]) + From f53e939fe4b947954a3130c84ccfdf38cf0fef7c Mon Sep 17 00:00:00 2001 From: sayaliparab Date: Tue, 11 Jun 2024 19:07:02 +0530 Subject: [PATCH 2/2] FormCss --- public/assets/css/light/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/css/light/main.css b/public/assets/css/light/main.css index 782f552..1deb9db 100644 --- a/public/assets/css/light/main.css +++ b/public/assets/css/light/main.css @@ -536,7 +536,7 @@ input[type=search]::-ms-reveal { /* Form Group Label */ .form-group label, label { font-size: 15px; - color: #f3342f; + color: #090101; letter-spacing: 1px; display: inline-block; margin-bottom: 0.5rem;