]> git.openstreetmap.org Git - osqa.git/commitdiff
Further fixes for subfolder hosting
authorAttila-Mihaly Balazs <dify.ltd@gmail.com>
Tue, 25 Mar 2014 12:35:26 +0000 (14:35 +0200)
committerAttila-Mihaly Balazs <dify.ltd@gmail.com>
Tue, 25 Mar 2014 12:35:26 +0000 (14:35 +0200)
forum/views/auth.py
forum/views/writers.py
forum_modules/facebookauth/authentication.py
forum_modules/oauthauth/consumer.py

index 01f62105e167792ca358a1d992808fe31c77f7d1..00b67dc2a7f1553ea7fdac52a1b43833dcb720f5 100644 (file)
@@ -89,7 +89,7 @@ def prepare_provider_signin(request, provider):
 
         try:
             request_url = provider_class.prepare_authentication_request(request,
 
         try:
             request_url = provider_class.prepare_authentication_request(request,
-                                                                        reverse('auth_provider_done',
+                                                                        reverse('auth_provider_done', prefix='/',
                                                                                 kwargs={'provider': provider}))
 
             return HttpResponseRedirect(request_url)
                                                                                 kwargs={'provider': provider}))
 
             return HttpResponseRedirect(request_url)
index 304032c52d33f4f992a89c38b305ba15f0474e17..597ddbaf09e5234a6f4a78e7e49299c21af947ac 100644 (file)
@@ -98,7 +98,7 @@ def ask(request):
 
                     if request.user.is_authenticated():
                         messages.info(request, _("Your question is pending until you %s.") % html.hyperlink(
 
                     if request.user.is_authenticated():
                         messages.info(request, _("Your question is pending until you %s.") % html.hyperlink(
-                            reverse('send_validation_email'), _("validate your email")
+                            django_settings.APP_URL + reverse('send_validation_email', prefix='/'), _("validate your email")
                         ))
                         return HttpResponseRedirect(reverse('index'))
                     else:
                         ))
                         return HttpResponseRedirect(reverse('index'))
                     else:
@@ -273,7 +273,7 @@ def answer(request, id):
 
             if request.user.is_authenticated():
                 messages.info(request, _("Your answer is pending until you %s.") % html.hyperlink(
 
             if request.user.is_authenticated():
                 messages.info(request, _("Your answer is pending until you %s.") % html.hyperlink(
-                    reverse('send_validation_email'), _("validate your email")
+                    django_settings.APP_URL + reverse('send_validation_email', prefix='/'), _("validate your email")
                 ))
                 return HttpResponseRedirect(question.get_absolute_url())
             else:
                 ))
                 return HttpResponseRedirect(question.get_absolute_url())
             else:
index b80c47767ff08846e8b49e960e6c675d30bf5871..c98eaf1b193ea29aff2192e19a143612496b4430 100644 (file)
@@ -8,6 +8,7 @@ from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateCo
 
 from django.conf import settings as django_settings
 from django.utils.encoding import smart_unicode
 
 from django.conf import settings as django_settings
 from django.utils.encoding import smart_unicode
+from django.core.urlresolvers import reverse
 from django.utils.translation import ugettext as _
 
 import settings
 from django.utils.translation import ugettext as _
 
 import settings
@@ -30,7 +31,8 @@ class FacebookAuthConsumer(AuthenticationConsumer):
 
     def process_authentication_request(self, request):
         try:
 
     def process_authentication_request(self, request):
         try:
-            args = dict(client_id=settings.FB_API_KEY, redirect_uri="%s%s" % (django_settings.APP_URL, request.path))
+            redirect_uri = "%s%s" % (django_settings.APP_URL, reverse('auth_provider_done', prefix='/', kwargs={'provider': 'facebook'}))
+            args = dict(client_id=settings.FB_API_KEY, redirect_uri=redirect_uri)
 
             args["client_secret"] = settings.FB_APP_SECRET  #facebook APP Secret
 
 
             args["client_secret"] = settings.FB_APP_SECRET  #facebook APP Secret
 
index bbbaac8d53757ec48fa9e20fd648c93ce98764c5..ee9bf97fb576a6e10837421d5f67f76ed08ed263 100644 (file)
@@ -52,7 +52,7 @@ class OAuthAbstractAuthConsumer(AuthenticationConsumer):
         parameters = {}
         # If the installation is configured to automatically redirect to the Twitter provider done page -- do it.
         if bool(TWITTER_AUTO_CALLBACK_REDIRECT):
         parameters = {}
         # If the installation is configured to automatically redirect to the Twitter provider done page -- do it.
         if bool(TWITTER_AUTO_CALLBACK_REDIRECT):
-            callback_url = '%s%s' % (APP_URL, reverse('auth_provider_done', kwargs={ 'provider' : 'twitter', }))
+            callback_url = '%s%s' % (APP_URL, reverse('auth_provider_done', prefix='/', kwargs={'provider' : 'twitter'}))
             # Pass
             parameters.update({
                 'oauth_callback' : callback_url,
             # Pass
             parameters.update({
                 'oauth_callback' : callback_url,