FIX: redirect to original URL after social signup

This commit is contained in:
Vinoth Kannan
2018-09-05 00:46:54 +05:30
parent 4382fb5fac
commit d8b543bb67
4 changed files with 23 additions and 0 deletions

View File

@@ -205,6 +205,11 @@ export default Ember.Controller.extend(
"accountChallenge"
);
const userFields = this.get("userFields");
const destinationUrl = this.get("authOptions.destination_url");
if (!Ember.isEmpty(destinationUrl)) {
$.cookie("destination_url", destinationUrl, { path: '/' });
}
// Add the userfields to the data
if (!Ember.isEmpty(userFields)) {
@@ -255,10 +260,12 @@ export default Ember.Controller.extend(
this.get("rejectedPasswords").pushObject(attrs.accountPassword);
}
this.set("formSubmitted", false);
$.cookie("destination_url", null);
}
},
() => {
this.set("formSubmitted", false);
$.cookie("destination_url", null);
return this.flash(I18n.t("create_account.failed"), "error");
}
);