mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 00:32:52 +08:00
FEATURE: Allow users to resend/update email from confirmation page
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||
import { ajax } from 'discourse/lib/ajax';
|
||||
import { extractError } from 'discourse/lib/ajax-error';
|
||||
import { userPath } from 'discourse/lib/url';
|
||||
import { changeEmail } from 'discourse/lib/user-activation';
|
||||
|
||||
export default Ember.Controller.extend(ModalFunctionality, {
|
||||
login: Ember.inject.controller(),
|
||||
@ -20,13 +19,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
changeEmail() {
|
||||
const login = this.get('login');
|
||||
|
||||
ajax(userPath('update-activation-email'), {
|
||||
data: {
|
||||
username: login.get('loginName'),
|
||||
password: login.get('loginPassword'),
|
||||
email: this.get('newEmail')
|
||||
},
|
||||
type: 'PUT'
|
||||
changeEmail({
|
||||
username: login.get('loginName'),
|
||||
password: login.get('loginPassword'),
|
||||
email: this.get('newEmail')
|
||||
}).then(() => {
|
||||
const modal = this.showModal('activation-resent', {title: 'log_in'});
|
||||
modal.set('currentEmail', this.get('newEmail'));
|
||||
|
Reference in New Issue
Block a user