diff --git a/apps/users/models/user.py b/apps/users/models/user.py index 5daa7b510..4bc196c7b 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -311,8 +311,8 @@ class User(AbstractUser): token = cache.get('%s_%s' % (self.id, remote_addr)) if not token: token = uuid.uuid4().hex - cache.set(token, self.id, expiration) - cache.set('%s_%s' % (self.id, remote_addr), token, expiration) + cache.set(token, self.id, expiration) + cache.set('%s_%s' % (self.id, remote_addr), token, expiration) return token def refresh_bearer_token(self, token):