mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 09:15:58 +08:00
If authentication is recieved, it's now also correctly validated
CURA-49
This commit is contained in:
parent
3a767c72f0
commit
054f7aaa83
@ -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…
x
Reference in New Issue
Block a user