summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/crypto
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-04-16 12:21:38 -0300
committerTomás Touceda <chiiph@leap.se>2014-04-16 12:21:38 -0300
commit90bbab2d49446934c7dd5f8c3ec84fd937dcd0b1 (patch)
tree10a1332c32f7251a59097b1cd598d528569070e2 /src/leap/bitmask/crypto
parent72aca6c71b08b27382d63297559f0fce7b9dfc1b (diff)
parenteece52ff0118af412b0e2bf7a4200ebf0bca2f16 (diff)
Merge remote-tracking branch 'refs/remotes/ivan/bug/fix-is_authenticated-method' into develop
Diffstat (limited to 'src/leap/bitmask/crypto')
-rw-r--r--src/leap/bitmask/crypto/srpauth.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py
index 895ab87e..192a9d5c 100644
--- a/src/leap/bitmask/crypto/srpauth.py
+++ b/src/leap/bitmask/crypto/srpauth.py
@@ -687,6 +687,18 @@ class SRPAuth(object):
with self._token_lock:
return self._token
+ def is_authenticated(self):
+ """
+ Return whether the user is authenticated or not.
+
+ :rtype: bool
+ """
+ user = self._srp_user
+ if user is not None:
+ return user.authenticated()
+
+ return False
+
__instance = None
def __init__(self, provider_config, signaler=None):
@@ -735,11 +747,7 @@ class SRPAuth(object):
:rtype: bool
"""
- user = self.__instance._srp_user
- if user is not None:
- return self.__instance.authenticated()
-
- return False
+ return self.__instance.is_authenticated()
def change_password(self, current_password, new_password):
"""