Pass redirect_url through setup form

When accessing a 'not set up' Nextcloud with a redirect_url parameter
the parameter will is added to the setup POST request, resulting in the
requested redirect after setup is complete.

This is required in scenarios where Nextcloud is used as authorization
provider like on the Spreedbox to allow redirection to the required page
when normally a login form would be shown but the setup form is shown
instead.
This commit is contained in:
Simon Eisenmann 2016-09-13 12:15:30 +02:00
parent 0543661064
commit 1a240a23e5
1 changed files with 11 additions and 0 deletions

View File

@ -79,6 +79,17 @@ $(document).ready(function() {
form.append(input);
}
// Add redirect_url
var redirectURL = getURLParameter('redirect_url');
if (redirectURL) {
var redirectURLInput = $('<input type="hidden">');
redirectURLInput.attr({
name: 'redirect_url',
value: redirectURL
});
form.append(redirectURLInput);
}
// Submit the form
form.appendTo(document.body);
form.submit();