Make device token revokation more explicit

This commit is contained in:
Raphael Michel
2019-04-02 09:36:07 +02:00
parent e75ae80fb5
commit 2d37c6d94d
5 changed files with 33 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ class DeviceTokenAuthentication(TokenAuthentication):
if not device.initialized:
raise exceptions.AuthenticationFailed('Device has not been initialized.')
if not device.api_token:
if device.revoked:
raise exceptions.AuthenticationFailed('Device access has been revoked.')
return AnonymousUser(), device