Fixed a bug with access control during first run
Requests against restricted resources could fail even though the first run wizard had been completed successfully.
This commit is contained in:
parent
54f24b43f0
commit
ccd2ddc056
2 changed files with 2 additions and 2 deletions
|
|
@ -101,7 +101,7 @@ def load_user(id):
|
|||
else:
|
||||
sessionid = None
|
||||
|
||||
if userManager is not None:
|
||||
if settings().getBoolean(["accessControl", "enabled"]) and userManager is not None:
|
||||
if sessionid:
|
||||
return userManager.findUser(userid=id, session=sessionid)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -700,7 +700,7 @@ def restricted_access(func):
|
|||
@functools.wraps(func)
|
||||
def decorated_view(*args, **kwargs):
|
||||
# if OctoPrint hasn't been set up yet, abort
|
||||
if settings().getBoolean(["server", "firstRun"]) and (octoprint.server.userManager is None or not octoprint.server.userManager.hasBeenCustomized()):
|
||||
if settings().getBoolean(["server", "firstRun"]) and settings().getBoolean(["accessControl", "enabled"]) and (octoprint.server.userManager is None or not octoprint.server.userManager.hasBeenCustomized()):
|
||||
return flask.make_response("OctoPrint isn't setup yet", 403)
|
||||
|
||||
apikey = octoprint.server.util.get_api_key(flask.request)
|
||||
|
|
|
|||
Loading…
Reference in a new issue