-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth) add confirm password to signup and settings
confirm password powered by directive: https://github.com/wongatech/angular-confirm-field + adding for attribute to labels and ids to associated elements + fixing invalid password error in settings HTML to ref pwd.old. instead of form.password... (Jade was ok) take note of new dependency in test/fixtures/bower.json (re-run bower install on current clones...)
- Loading branch information
1 parent
16f928b
commit 2d8a6ec
Showing
8 changed files
with
86 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ <h1>Email</h1> | |
<form role="form" name="email" ng-submit="changeEmail()" novalidate> | ||
|
||
<div class="form-group has-feedback"> | ||
<label>Current Email</label> | ||
<input type="email" name="email" class="form-control" ng-model="user.email" placeholder='ex. [email protected]' /> | ||
<label for="email">Current Email</label> | ||
<input type="email" id="email" name="email" class="form-control" ng-model="user.email" placeholder='ex. [email protected]' /> | ||
<p class="help-block" ng-show="!email.email.$valid"> | ||
| Email not valid | ||
</p> | ||
|
@@ -28,19 +28,19 @@ <h1><% if (filters.oauth) { %>{{ user.localEnabled ? 'Change' : 'Set' }}<% } els | |
<form name="pwd" ng-submit="<% if(filters.oauth) { %>!user.localEnabled ? setPassword() : <% } %>changePassword()" novalidate> | ||
|
||
<div class="form-group"> | ||
<label>Current Password</label> | ||
<label for="oldPass">Current Password</label> | ||
|
||
<input type="password" name="old" placeholder='ex. password123' class="form-control" ng-model="user.oldPassword" | ||
<input type="password" id="oldPass" name="old" placeholder='ex. password123' class="form-control" ng-model="user.oldPassword" | ||
mongoose-error <% if (filters.oauth) { %>ng-disabled='!user.localEnabled' <% } %>/> | ||
<p class="help-block" ng-show="form.password.$error.mongoose"> | ||
<p class="help-block" ng-show="pwd.old.$error.mongoose"> | ||
{{ errors.other }} | ||
</p> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label>New Password</label> | ||
<label for="newPass">New Password</label> | ||
|
||
<input type="password" name="new" placeholder='ex. GoofyM1ckeyDonald&Pluto' class="form-control" ng-model="user.newPassword" | ||
<input type="password" id="newPass" name="new" placeholder='ex. GoofyM1ckeyDonald&Pluto' class="form-control" ng-model="user.newPassword" | ||
ng-minlength="3" | ||
required /> | ||
<p class="help-block" | ||
|
@@ -49,6 +49,21 @@ <h1><% if (filters.oauth) { %>{{ user.localEnabled ? 'Change' : 'Set' }}<% } els | |
</p> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="passwordConfirm">Confirm New Password</label> | ||
|
||
<input type="password" id="passwordConfirm" name="passwordConfirm" class="form-control" | ||
ng-model="passwordConfirm" | ||
ng-confirm-field | ||
confirm-against="user.newPassword" | ||
ng-minlength="3" | ||
required /> | ||
<p class="help-block" | ||
ng-show="pwd.passwordConfirm.$error.noMatch && pwd.submitted"> | ||
Passwords must match. | ||
</p> | ||
</div> | ||
|
||
<p class="help-block"> {{ message }} </p> | ||
|
||
<button class="btn btn-lg btn-primary" type="submit">Save changes</button> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ div(ng-include='"components/navbar/navbar.html"') | |
form(role='form', name='email', ng-submit='changeEmail()', novalidate) | ||
|
||
.form-group.has-feedback | ||
label Current Email | ||
input.form-control(type='email', name='email', ng-model='user.email', placeholder='ex. [email protected]') | ||
label(for="email") Current Email | ||
input.form-control#email(type='email', name='email', ng-model='user.email', placeholder='ex. [email protected]') | ||
span.glyphicon.glyphicon-ok.form-control-feedback(ng-if='email.confirmed', title='email confirmed') | ||
p.help-block(ng-show='!email.email.$valid') | ||
| Email not valid | ||
|
@@ -24,17 +24,24 @@ div(ng-include='"components/navbar/navbar.html"') | |
form(role='form', name='pwd', ng-submit='<% if(filters.oauth) { %>!user.localEnabled ? setPassword() : <% } %>changePassword()', novalidate) | ||
|
||
.form-group | ||
label Current Password | ||
input.form-control(type='password', name='old', placeholder='ex. password123', ng-model='user.oldPassword', <% if (filters.oauth) { %>ng-disabled='!user.localEnabled', <% } %>mongoose-error='') | ||
label(for="oldPass") Current Password | ||
input.form-control#oldPass(type='password', name='old', placeholder='ex. password123', ng-model='user.oldPassword', <% if (filters.oauth) { %>ng-disabled='!user.localEnabled', <% } %>mongoose-error='') | ||
p.help-block(ng-show='pwd.old.$error.mongoose') | ||
| {{ errors.other }} | ||
|
||
.form-group | ||
label New Password | ||
input.form-control(type='password', name='new', placeholder='ex. GoofyM1ckeyDonald&Pluto', ng-model='user.newPassword', ng-minlength='3', required) | ||
label(for="newPass") New Password | ||
input.form-control#newPass(type='password', name='new', placeholder='ex. GoofyM1ckeyDonald&Pluto', ng-model='user.newPassword', ng-minlength='3', required) | ||
p.help-block(ng-show='(pwd.new.$error.minlength || pwd.new.$error.required) && (pwd.new.$dirty || pwd.submitted)') | ||
| Password must be at least 3 characters. | ||
|
||
.form-group | ||
label(for="passwordConfirm") Confirm New Password | ||
input.form-control#passwordConfirm(type='password', name='passwordConfirm', ng-model='passwordConfirm', ng-minlength='3', required='\ | ||
', ng-confirm-field='', confirm-against="user.newPassword") | ||
p.help-block(ng-show='form.passwordConfirm.$error.noMatch && pwd.submitted') | ||
| Passwords must match. | ||
|
||
p.help-block {{ message }} | ||
|
||
button.btn.btn-lg.btn-primary(type='submit') Save changes | ||
|
@@ -45,4 +52,4 @@ div(ng-include='"components/navbar/navbar.html"') | |
//- h1 Social accounts | ||
//- .col-sm-12 | ||
<% } %> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters