X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/67552e19bc548b78c18967e97f0c0328074a3576..1a12630094dd57a463a8a1d4f64744e3b3b245af:/src/api/piston_patch.py diff --git a/src/api/piston_patch.py b/src/api/piston_patch.py index 4bf9b615d..fb3987bde 100644 --- a/src/api/piston_patch.py +++ b/src/api/piston_patch.py @@ -15,6 +15,10 @@ from piston import oauth from piston.authentication import initialize_server_request, INVALID_PARAMS_RESPONSE, send_oauth_error +class HttpResponseAppRedirect(HttpResponseRedirect): + allowed_schemes = HttpResponseRedirect.allowed_schemes + ['wolnelekturyapp'] + + class OAuthAuthenticationForm(forms.Form): oauth_token = forms.CharField(widget=forms.HiddenInput) oauth_callback = forms.CharField(widget=forms.HiddenInput) # changed from URLField - too strict @@ -52,6 +56,7 @@ class OAuthAuthenticationForm(forms.Form): # The only thing changed in the views below is the form used +# and also the Http Redirect class def oauth_auth_view(request, token, callback, params): @@ -102,7 +107,7 @@ def oauth_user_auth(request): callback = getattr(settings, 'OAUTH_CALLBACK_VIEW') return get_callable(callback)(request, token) - response = HttpResponseRedirect(callback + args) + response = HttpResponseAppRedirect(callback + args) except oauth.OAuthError, err: response = send_oauth_error(err)