Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f3f879f

Browse files
committed
F
1 parent 5318d78 commit f3f879f

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

‎.env‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiStoreHash = 4zjutairi8
55
appClientSecret = 18ee9612d7fbe54ca19f4c5005e871070088c5182af1348803198fb69cbe1558
66
appClientId = t3m0jh3bbg8dcqnwd5xcy3u9o41vmyz
77

8-
callBackURL = http://57186a6b82ae.ngrok.io/cb/auth
8+
callBackURL = https://dd6100868f41.ngrok.io/cb/auth
99

1010
DB_NAME = def7fp7u5sfj6j
1111
DB_USER = ywrpximushfior

‎bigCommerce/urls.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
path('admin/', admin.site.urls),
2323
path('' , include('dashboard.urls')),
2424
path('bc-api/' , include('api.urls')),
25-
path('cb/' , include('callback.urls'))
25+
path('' , include('callback.urls'))
2626

2727

2828
]

‎callback/views.py‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from django.shortcuts import render
22
from django.http import HttpResponse
3-
from .models import Auth
43
import requests
54
import datetime
65

@@ -25,11 +24,8 @@ def auth(request):
2524
code = request.GET.get('code')
2625
context = request.GET.get('context')
2726
scope = request.GET.get('scope')
28-
29-
# redirect = 'https://inventroman.herokuapp.com/cb/auth'
3027
redirect = config('callBackURL')
3128

32-
3329
store_hash = context.split('/')[1]
3430

3531
client = BigcommerceApi(client_id=client_id(), store_hash=config('apiStoreHash'))
@@ -38,14 +34,12 @@ def auth(request):
3834
bc_user_id = token['user']['id']
3935
email = token['user']['email']
4036
access_token = token['access_token']
41-
42-
a , created = Auth.objects.get_or_create(storehash = store_hash)
43-
a.user_id = bc_user_id
44-
a.mail = email
45-
a.storehash = store_hash
46-
a.token = access_token
47-
a.save()
37+
pp = request.build_absolute_uri()
38+
print('this is url ' + pp)
39+
# b = Auth.objects.create(user_id = bc_user_id ,mail = email, storehash = store_hash, token = access_token)
4840

49-
return render(request , 'index.html')
41+
return render(request , 'auth.html')
5042

5143
return HttpResponse("Something Went Wrong")
44+
45+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /