Browse Source

Change token url to improve security

Mohidul Islam 5 years ago
parent
commit
e50891966f
4 changed files with 3 additions and 4 deletions
  1. 0 1
      analytics/background_job.py
  2. 1 1
      dashboard/views.py
  3. 1 1
      gauth/auth_utils.py
  4. 1 1
      gauth/urls.py

+ 0 - 1
analytics/background_job.py

@@ -10,4 +10,3 @@ def weekly_report(location_id):
         .annotate(total=Count('star_rating')).order_by('star_rating')
         .annotate(total=Count('star_rating')).order_by('star_rating')
     # TODO:
     # TODO:
     # make a table with reviews count and bad reviews and send mail to a particular email add.
     # make a table with reviews count and bad reviews and send mail to a particular email add.
-    

+ 1 - 1
dashboard/views.py

@@ -64,7 +64,7 @@ class UnRepliedReviewList(LoginRequiredMixin, View):
             review.save()
             review.save()
             messages.success(request, f'Your reply has been posted!')
             messages.success(request, f'Your reply has been posted!')
         elif response.status_code == 404:
         elif response.status_code == 404:
-            review_reply = Reply(replied_text=reply, create_time=timezone.now())
+            review_reply = Reply(replied_text=replied_text, create_time=timezone.now())
             review_reply.save()
             review_reply.save()
             review.reply = review_reply
             review.reply = review_reply
             review.save()
             review.save()

+ 1 - 1
gauth/auth_utils.py

@@ -5,7 +5,7 @@ from django.conf import settings
 from .models import UserModel
 from .models import UserModel
 from requests import get
 from requests import get
 
 
-ACCESS_TOKEN_URI = settings.HOST_URI + '/token'
+ACCESS_TOKEN_URI = settings.HOST_URI + '/gmb_access_token/token/access_toke_of_user'
 
 
 
 
 def get_auth_header():
 def get_auth_header():

+ 1 - 1
gauth/urls.py

@@ -2,7 +2,7 @@ from django.urls import path
 from .views import google_auth, authorize, oauth2callback, get_token
 from .views import google_auth, authorize, oauth2callback, get_token
 
 
 urlpatterns = [
 urlpatterns = [
-    path('token', get_token, name='token'),
+    path('gmb_access_token/token/access_toke_of_user', get_token, name='token'),
     path('gmb-authenticate/', google_auth, name='gmb-auth'),
     path('gmb-authenticate/', google_auth, name='gmb-auth'),
     path('authorize', authorize, name='authorize'),
     path('authorize', authorize, name='authorize'),
     path('oauth2callback', oauth2callback, name='oauth2callback'),
     path('oauth2callback', oauth2callback, name='oauth2callback'),