some better parameterization of NK LinK
This commit is contained in:
@@ -29,7 +29,7 @@ import gzip
|
||||
|
||||
from rowsandall_app.settings import (
|
||||
NK_CLIENT_ID, NK_REDIRECT_URI, NK_CLIENT_SECRET,
|
||||
SITE_URL, NK_API_LOCATION,
|
||||
SITE_URL, NK_API_LOCATION,NK_OAUTH_LOCATION,
|
||||
UPLOAD_SERVICE_URL, UPLOAD_SERVICE_SECRET,
|
||||
)
|
||||
|
||||
@@ -48,13 +48,13 @@ oauth_data = {
|
||||
'client_id': NK_CLIENT_ID,
|
||||
'client_secret': NK_CLIENT_SECRET,
|
||||
'redirect_uri': NK_REDIRECT_URI,
|
||||
'autorization_uri': "https://oauth-stage.nkrowlink.com/oauth/authorize",
|
||||
'autorization_uri': NK_OAUTH_LOCATION+"/oauth/authorize",
|
||||
'content_type': 'application/json',
|
||||
'tokenname': 'nktoken',
|
||||
'refreshtokenname': 'nkrefreshtoken',
|
||||
'expirydatename': 'nktokenexpirydate',
|
||||
'bearer_auth': True,
|
||||
'base_url': "https://oauth-stage.nkrowlink.com/oauth/token",
|
||||
'base_url': NK_OAUTH_LOCATION+"/oauth/token",
|
||||
'scope':'read',
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ def default(o): # pragma: no cover
|
||||
if isinstance(o, numpy.int64): return int(o)
|
||||
raise TypeError
|
||||
|
||||
from rowsandall_app.settings import NK_OAUTH_LOCATION
|
||||
|
||||
# Send workout to TP
|
||||
@permission_required('workout.change_workout',fn=get_workout_by_opaqueid,raise_exception=True)
|
||||
@@ -407,7 +408,7 @@ def rower_nk_authorize(request): # pragma: no cover
|
||||
"redirect_uri": NK_REDIRECT_URI,
|
||||
}
|
||||
|
||||
url = "https://oauth-stage.nkrowlink.com/oauth/authorize?"+urllib.parse.urlencode(params)
|
||||
url = NK_OAUTH_LOCATION+"/oauth/authorize?"+urllib.parse.urlencode(params)
|
||||
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
@@ -333,6 +333,7 @@ NK_CLIENT_ID = CFG["nk_client_id"]
|
||||
NK_CLIENT_SECRET = CFG["nk_client_secret"]
|
||||
NK_REDIRECT_URI = CFG["nk_redirect_uri"]
|
||||
NK_API_LOCATION = CFG["nk_api_location"]
|
||||
NK_OAUTH_LOCATION = CFG["nk_oauth_location"]
|
||||
NK_VIEWER_LOCATION = CFG["nk_viewer_location"]
|
||||
|
||||
# Full Site URL
|
||||
|
||||
Reference in New Issue
Block a user