mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
webui: add bounce url to reset_password.html
reset_password.html now redirects browser to URL specified in 'redirect' uri component (if present). The component has to be URI encoded. ie (in browser console): $ encodeURIComponent('http://pvoborni.fedorapeople.org/doc/#!/guide/Debugging') --> "http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging" --> https://my.freeipa.server/ipa/ui/reset_password.html?redirect=http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging https://fedorahosted.org/freeipa/ticket/4440 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
parent
ac7df79a43
commit
8288135b5b
@ -114,6 +114,7 @@ RP.on_submit = function() {
|
||||
} else {
|
||||
RP.reset_form();
|
||||
RP.show_success("Password reset was successful.");
|
||||
RP.redirect();
|
||||
}
|
||||
};
|
||||
|
||||
@ -140,6 +141,29 @@ RP.show_success = function(message) {
|
||||
$('.alert-success').css('display', '');
|
||||
};
|
||||
|
||||
RP.parse_uri = function() {
|
||||
var opts = {};
|
||||
if (window.location.search.length > 1) {
|
||||
var couples = window.location.search.substr(1).split("&");
|
||||
for (var i=0,l=couples.length; i < l; i++) {
|
||||
var couple = couples[i].split("=");
|
||||
var key = decodeURIComponent(couple[0]);
|
||||
var value = couple.length > 1 ? decodeURIComponent(couple[1]) : '';
|
||||
opts[key] = value;
|
||||
}
|
||||
}
|
||||
return opts;
|
||||
};
|
||||
|
||||
RP.redirect = function() {
|
||||
|
||||
var opts = RP.parse_uri();
|
||||
var url = opts['redirect'];
|
||||
if (url) {
|
||||
window.location = url;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
RP.init = function() {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user