Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
sickrage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
26
Issues
26
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SiCKRAGE
sickrage
Commits
1d2a13be
Commit
1d2a13be
authored
Jan 10, 2020
by
echel0n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added exception handling for grabbing token endpoint from auth server.
parent
17361b69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
sickrage/core/api/__init__.py
sickrage/core/api/__init__.py
+7
-1
No files found.
sickrage/core/api/__init__.py
View file @
1d2a13be
...
...
@@ -17,7 +17,6 @@ class API(object):
self
.
api_url
=
'https://www.sickrage.ca/api/v3/'
self
.
client_id
=
sickrage
.
app
.
oidc_client_id
self
.
client_secret
=
sickrage
.
app
.
oidc_client_secret
self
.
token_url
=
sickrage
.
app
.
oidc_client
.
well_known
[
'token_endpoint'
]
@
property
def
session
(
self
):
...
...
@@ -61,6 +60,13 @@ class API(object):
'scope'
:
value
.
scope
if
isinstance
(
value
,
OAuth2Token
)
else
value
.
get
(
'scope'
)
}))
@
property
def
token_url
(
self
):
try
:
return
sickrage
.
app
.
oidc_client
.
well_known
[
'token_endpoint'
]
except
requests
.
exceptions
.
RequestException
:
return
"https://auth.sickrage.ca/auth/realms/sickrage/protocol/openid-connect/token"
@
property
def
userinfo
(
self
):
return
self
.
_request
(
'GET'
,
'userinfo'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment