Custom password requirements on forgot password/ password recovery - Parse.com -
i have ios app, , using parse.com, can allow user reset if forget using parse.com api. problem lies in fact when user resets password, none of criteria password can enforced (or @ to the lowest degree haven't found way yet) or field verify come in in right password. i'm wondering if out there has had solution this.
my situation exactly: when type reset password in, can apply minimum criteria such 1 capital letter, 1 number, , 1 lowercase letter? in addition, have verify password field below.
i've tried client-side js validation no success. i've included code blocks below. give thanks you!!!!
html
<div class="row"> <div class="medium-6 medium-offset-3 small-10 small-offset-1 columns"> <form id='form' action='#' method='post'> <label>new password <span id='username_label'></span></label> <input name="new_password" type="password" /> <input name='utf-8' type='hidden' value='✓' /> <input name="username" id="username" type="hidden" /> <input name="token" id="token" type="hidden" /> <button>change password</button> </form> </div>
js
<script language='javascript' type='text/javascript'> <!-- window.onload = function() { var urlparams = {}; (function () { var pair, // match. index 0 total match; 1 & 2 key & val. tokenize = /([^&=]+)=?([^&]*)/g, // decodeuricomponents escapes leave +s should ' ' re_space = function (s) { homecoming decodeuricomponent(s.replace(/\+/g, " ")); }, // substring cutting off leading '?' querystring = window.location.search.substring(1); while (pair = tokenize.exec(querystring)) urlparams[re_space(pair[1])] = re_space(pair[2]); })(); var base of operations = 'https://www.parse.com'; var id = urlparams['id']; document.getelementbyid('form').setattribute('action', base of operations + '/apps/' + id + '/request_password_reset'); document.getelementbyid('username').value = urlparams['username']; document.getelementbyid('username_label').appendchild(document.createtextnode(urlparams['username'])); document.getelementbyid('token').value = urlparams['token']; if (urlparams['error']) { document.getelementbyid('error').appendchild(document.createtextnode(urlparams['error'])); } if (urlparams['app']) { document.getelementbyid('app').appendchild(document.createtextnode(' ' + urlparams['app'])); } } $(function() { $('#form').submit(function() { if (document.getelementbyid('new_password').length == 2) { // wrong alert('there problem first field'); homecoming false; } else { homecoming true; } }); }); //-->
parse.com passwords forgot-password password-checker
No comments:
Post a Comment