mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
If authentication is recieved, it's now also correctly validated
CURA-49
This commit is contained in:
parent
3a767c72f0
commit
054f7aaa83
1 changed files with 2 additions and 4 deletions
|
@ -335,15 +335,13 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
data = json.loads(bytes(reply.readAll()).decode("utf-8"))
|
data = json.loads(bytes(reply.readAll()).decode("utf-8"))
|
||||||
print("auth check response")
|
print("auth check response")
|
||||||
if data.get("message", "") == "authorized":
|
if data.get("message", "") == "authorized":
|
||||||
Logger.log("i", "Authentication completed.")
|
Logger.log("i", "Authentication was approved")
|
||||||
self.setAuthenticationState(AuthState.Authenticated)
|
self._verifyAuthentication() # Ensure that the verification is really used and correct.
|
||||||
elif data.get("message", "") == "unauthorized":
|
elif data.get("message", "") == "unauthorized":
|
||||||
Logger.log("i", "Authentication was denied.")
|
Logger.log("i", "Authentication was denied.")
|
||||||
self.setAuthenticationState(AuthState.AuthenticationDenied)
|
self.setAuthenticationState(AuthState.AuthenticationDenied)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
#Logger.log("i", "Authentication was denied.")
|
|
||||||
#self.setAuthenticationState(AuthState.AuthenticationDenied)
|
|
||||||
|
|
||||||
elif reply.operation() == QNetworkAccessManager.PostOperation:
|
elif reply.operation() == QNetworkAccessManager.PostOperation:
|
||||||
if "/auth/request" in reply.url().toString():
|
if "/auth/request" in reply.url().toString():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue