Skip to content

Commit

Permalink
OpenSUSE 15.1: Use default authentication service
Browse files Browse the repository at this point in the history
Signed-off-by: Aline Manera <[email protected]>
  • Loading branch information
alinefm committed Dec 26, 2019
1 parent 50135ea commit fc586b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/wok/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ def _pam_conv(auth, query_list, userData=None):
result.value = 0
# Debian 10: handle differences on pam module
except AttributeError:
# Use default service as it may vary from Debian 10 to OpenSUSE 15.1
result.value = 0 if auth.authenticate(
username=username, password=password, service=service) else 1
username=username, password=password) else 1
except PAM.error as e:
result.value = e.args[1]

Expand Down Expand Up @@ -268,8 +269,8 @@ def check_auth_session():
wokRobot = cherrypy.request.headers.get('Wok-Robot')
if wokRobot == 'wok-robot':
if (
time.time() - cherrypy.session[template.REFRESH] >
int(config.get('server', 'session_timeout')) * 60
time.time() - cherrypy.session[template.REFRESH]
> int(config.get('server', 'session_timeout')) * 60
):
cherrypy.session[USER_NAME] = None
cherrypy.lib.sessions.expire()
Expand Down
2 changes: 1 addition & 1 deletion src/wok/plugins/kimchi

0 comments on commit fc586b7

Please sign in to comment.