Allow user lookup by apikey
This plugin breaks the GCode Viewer as is. When using this plugin and accessing the GCode Viewer, one gets this error in the log: TypeError: findUser() got an unexpected keyword argument 'apikey' This commit ensures that the findUser function knows how to handle the 'apikey' parameter from ~/octoprint/server/util/__init__.py if submitted.
This commit is contained in:
parent
d750a796ae
commit
ef92234e65
|
@ -50,8 +50,8 @@ class LDAPUserManager(FilebasedUserManager,
|
||||||
if FilebasedUserManager.findUser(self, username) is not None:
|
if FilebasedUserManager.findUser(self, username) is not None:
|
||||||
return FilebasedUserManager.changeUserPassword(self, username, password)
|
return FilebasedUserManager.changeUserPassword(self, username, password)
|
||||||
|
|
||||||
def findUser(self, userid=None, session=None):
|
def findUser(self, userid=None, apikey=None, session=None):
|
||||||
local_user = FilebasedUserManager.findUser(self, userid, session)
|
local_user = FilebasedUserManager.findUser(self, userid, apikey, session)
|
||||||
#If user not exists in local database, search it on LDAP
|
#If user not exists in local database, search it on LDAP
|
||||||
if userid and not local_user:
|
if userid and not local_user:
|
||||||
if(self.findLDAPUser(userid)):
|
if(self.findLDAPUser(userid)):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user