Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
a054f444
Commit
a054f444
authored
Oct 12, 2016
by
Julian Rother
Browse files
Fixed handling of unset L2P_APIKEY, closes #68
parent
bdfe0846
Changes
2
Hide whitespace changes
Inline
Side-by-side
l2pauth.py
View file @
a054f444
...
...
@@ -16,6 +16,8 @@ def oauthget(endpoint, **args):
@
app
.
route
(
'/l2pauth'
)
def
start_l2pauth
():
if
'L2P_APIKEY'
not
in
config
:
return
render_template
(
"500.html"
),
500
code
=
oauthget
(
'code'
,
scope
=
'l2p2013.rwth'
)
session
[
'oauthcode'
]
=
code
[
'device_code'
]
session
[
'oauthscope'
]
=
'l2p'
...
...
@@ -23,6 +25,8 @@ def start_l2pauth():
@
app
.
route
(
'/rwthauth'
)
def
start_rwthauth
():
if
'L2P_APIKEY'
not
in
config
:
return
render_template
(
"500.html"
),
500
code
=
oauthget
(
'code'
,
scope
=
'userinfo.rwth'
)
session
[
'oauthcode'
]
=
code
[
'device_code'
]
session
[
'oauthscope'
]
=
'rwth'
...
...
@@ -30,6 +34,8 @@ def start_rwthauth():
@
app
.
before_request
def
finish_oauth
():
if
'L2P_APIKEY'
not
in
config
:
return
if
'oauthcode'
not
in
session
or
'oauthscope'
not
in
session
:
return
token
=
oauthget
(
'token'
,
code
=
session
[
'oauthcode'
],
grant_type
=
'device'
)
...
...
server.py
View file @
a054f444
...
...
@@ -572,7 +572,6 @@ import importer
import
sorter
if
'ICAL_URL'
in
config
:
import
meetings
if
'L2P_APIKEY'
in
config
:
import
l2pauth
import
l2pauth
import
jobs
import
timetable
Write
Preview
Supports
Markdown
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