summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/crypto/srpauth.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-04-16 12:18:31 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-04-16 12:18:31 -0300
commiteece52ff0118af412b0e2bf7a4200ebf0bca2f16 (patch)
tree10a1332c32f7251a59097b1cd598d528569070e2 /src/leap/bitmask/crypto/srpauth.py
parent72aca6c71b08b27382d63297559f0fce7b9dfc1b (diff)
Use authenticated() properly.
Diffstat (limited to 'src/leap/bitmask/crypto/srpauth.py')
-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):
"""