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 c528585

Browse files
committed
F
1 parent c4e7c42 commit c528585

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

‎api/views.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@
1212

1313

1414

15+
def client_secret():
16+
return config('appClientSecret')
17+
18+
1519
def authData(request ):
1620
payload = request.GET.get('payload')
1721
x = payload.split("=")
18-
y = x[1].split(".")
19-
decoded = url64.decode(y[0])
22+
a = BigcommerceApi.oauth_verify_payload(x, client_secret())
23+
__store_hash = a['store_hash']
24+
2025

21-
json_object = json.loads(decoded)
22-
__store_hash =json_object["store_hash"]
26+
# y = x[1].split(".")
27+
# decoded = url64.decode(y[0])
28+
# json_object = json.loads(decoded)
29+
# __store_hash =json_object["store_hash"]
2330

2431
authData = get_object_or_404(Auth, storehash = __store_hash)
2532
token = authData.token

‎callback/views.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def auth(request):
3232

3333
store_hash = context.split('/')[1]
3434

35-
client = BigcommerceApi(client_id=client_id(), store_hash=config('apiStoreHash'))
35+
client = BigcommerceApi(client_id=client_id(), store_hash=store_hash)
3636

3737
token = client.oauth_fetch_token(client_secret(), code, context, scope, redirect)
3838
bc_user_id = token['user']['id']

0 commit comments

Comments
(0)

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