A login screen for user email and password is generating an error that I have not been able to reproduce. I have looked extensively for a solution, and everything I see is referencing atob or urlEncoding issues. Virtually nothing about btoa.
<input type="password" id="loginPassword" placeholder="password" class="registerFields" ng-model="loginInfo.password"></input>
$scope.userLogin = function() {
// check user on back end
var pass64 = btoa($scope.loginInfo.password) ; // <-- error generated here
....
} ;
I am encoding the string to pass back to my server, which decodes the string using PHP then properly compares the password to what is stored in the DB.
$user_password = base64_decode($inObj['upass']) ;
if (password_verify($user_password,$rows[0]['user_password'])) {
...
}
Everything I have been reading is the error that is being reported would be caused by users entering Unicode characters into the password field. Is this the only case that could cause this error or are there others? Trying to replicate the error I have entered about a dozen unicode strings, even the enter key (U+2386) but every example I am testing with does not produce an error.
- What characters or strings could be causing this so that I can try to replicate it?
- What can I do to prevent the error OR, if possible, prevent unicode characters from being entered as a password (is that even a good idea) ?