I have a sign up form with email and password/repeat-password fields, using Bootstrap 4 and jQuery. These get submitted to my API using jQuery $.post().
The issue is that even if the signup fails - for example if the email already exists - Chrome offers to save the password. This is annoying.
How can I prevent Chrome from doing so only if the signup fails, but not if it succeeds?
When searching I've only found questions and answers about how to completely disable the feature - but I want it to be disabled only if the POST failed, not if it was successful. Also, I do not wish to disable the password autocomplete feature.
Related
I'm having a problem with reCaptcha validation.
I want to validate the reCaptcha V2 in JavaScript to identify a special case that isn't processed correctly on the server-side validation (and no, there is no way for me to change the server-side validation). This way I can display a message informing the user that his form post won't be accepted...
I asked about the original problem here, but I have no solution for now: Google reCaptcha: Unable to validate in time, I will not fix the original problem, I want a workaround to display a message when the Captcha returns a specific value.
How do I identify in JS the following reCaptcha response:
REQ_PARAM_NAME::validated-captcha
REQ_PARAM_VALUE::Pair(false,Unable to validate in time. Response is assumed correct. 101781)
What are the properties available in the Captcha response objet that will allow me to identity one specific rejection reason "Unable to validate in time...".
I am using ReCaptcha 2 on a webpage. The user enters the username and password and is validated through an Ajax call. (Of course, the user will need to verify ReCaptcha before clicking the submit button). If the validation fails, I want to give another chance to resubmit data. However, the ReCaptcha validation fails with 'duplcate submission error' It seems that a validated ReCaptcha cannot be submitted again. So my question is -- how can I reset a verified ReCaptcha so that the user could reverify it? I am using JavaScript, jQuery and Vue.js
Use the reset() method, e.g
grecaptcha.reset();
I did a simple login page using HTML, Javascript. I validate my username and password using 'CGI'. When I click login button, a script 'login.cgi' been called using 'AJAX'. It is a POST method. Once I logged into my website, I went to Inspect element in firefox and clicked Network tab. I selected my 'login.cgi' under the Network tab. When I select the login.cgi, I can see the information of Headers, Cookies, Params, Response and Timings. I clicked Params field and checked that I can view my username and password in a plain text as parameters of that cgi script. I wish to hide my password field from this Inspect element feature. How can I do this?
If the password on your storage are hashed, and you know what alghoritm is used, you can hash your password with the same hash before to send it with post.
Then you can compare this 2 hash.
But what you have seen, it's a classic network problem, you must use an ssl connection to avoid the other person in the network with some attack can read your credentials.
This is your real problem not that the user who have written his credential can see his credentials in the network debugger tab.
I have created 2 pages in asp.net login and signup.
Now I want to check whether the username entered is already present before inserting data into database on signup page. I want to do this validation using javascript.
I tried doing it using compare validator but it did not worked.
Here are some way to do this.
You send all the username to the javascript when the page load and validate against the username list.
You make an AJAX query to your server to validate the username from the client side.
When the user submit the signup form, you validate the username received against your database and send an error if you find it.
You can use ajax to call a server side method that verify if the username already exist. This can be done very easy with JQuery. Look at the documentation here: http://api.jquery.com/jQuery.ajax/
i use remote method of validator for checking if username exists in DB
my scenario:
form with one field (username of course)
i filled field
it passes validation, but i don't sending form yet
going to DB inserting username that i filled in form that i still don't sent yet
returning to my form press on submit btn
voila, it pass validation (here the issue if u don't understand yet)
of course i did validation on the server side too, but it will be great that validation for remote method will fire too when sending form
p.s. i'm using 1.5.5 version but see that this issue still exists
If I'm reading this properly, jQuery is not at fault here.
If this isn't correct let me know. I am imagining a registration form.
I go to your form, enter a username. jQuery says the username is available using the remote validation technique.
Before I click submit, someone else submits the same form with the same username, and gets it.
I can still submit the form, even though I have an already taken username.
This is a classic scenario. A concurrency problem. The data is now stale that was pulled by jQuery validation during my registration. You need to adjust for this scenario in your remote page or make jquery validation run on form submit as well. You could just call validate() on your form in the submit method of your form.