Clean up password reset
This commit is contained in:
parent
8e11942521
commit
1605f34dcc
7 changed files with 35 additions and 18 deletions
|
@ -7,6 +7,6 @@
|
|||
</form>
|
||||
<br>
|
||||
<div>
|
||||
Forget your password? {{link-to 'Request a lockout email.' 'users.requestlockouthelp'}}
|
||||
{{link-to 'Forget your password?' 'users.requestlockouthelp'}}
|
||||
</div>
|
||||
{{/x-application}}
|
||||
|
|
|
@ -24,7 +24,7 @@ export default Ember.Controller.extend({
|
|||
},
|
||||
};
|
||||
ajaxRequest(url, options, this.get('session'));
|
||||
this.transitionTo('protected.users.index');
|
||||
this.transitionToRoute('protected.users.index');
|
||||
this.get('flashMessages').information('Your password has been changed.');
|
||||
},
|
||||
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
import Ember from 'ember';
|
||||
import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
export default Ember.Route.extend(UnauthenticatedRouteMixin, {
|
||||
session: Ember.inject.service('session'),
|
||||
currentUser: Ember.inject.service('session-account'),
|
||||
|
||||
beforeModel: function(transition) {
|
||||
this._super(transition);
|
||||
|
||||
let token = Ember.get(transition, 'queryParams.token');
|
||||
this.get('session').authenticate('authenticator:jwt-resolved', token);
|
||||
this.get('session').authenticate('authenticator:jwt-resolved', token).then(() => {
|
||||
this.get('currentUser.account').then((account) => {
|
||||
this.transitionTo('protected.users.changepassword', account.get('id'));
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ export default Ember.Controller.extend({
|
|||
data: { email: this.get('email') },
|
||||
};
|
||||
ajaxRequest(url, options, this.get('session'));
|
||||
this.transitionTo('login');
|
||||
this.transitionToRoute('login');
|
||||
this.get('flashMessages').information('Please check your email');
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="grid-1">
|
||||
<div class="span-1">
|
||||
<fieldset>
|
||||
<legend>Account Lockout Access</legend>
|
||||
<legend>Account Lockout/Password Reset</legend>
|
||||
<form {{action 'save' on='submit'}}>
|
||||
<ul>
|
||||
<li>
|
||||
|
|
Reference in a new issue