summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/gui/login.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-05-21 18:18:58 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-05-21 18:45:54 -0300
commitd0a9ecf0cba998b44a216c5cdf1800eea152f379 (patch)
tree1fd1c072a004719bc101e74e63e7c8c7219cd1c2 /src/leap/bitmask/gui/login.py
parent2ba353fbc87eb81dde2f169b8facdb2104107f70 (diff)
Update username regex to support the same as webapp.
Rename password util to credentials and add a username check helper. Move the username regexp to the credentials module. Closes #5695.
Diffstat (limited to 'src/leap/bitmask/gui/login.py')
-rw-r--r--src/leap/bitmask/gui/login.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py
index ac7ad878..f66e71d9 100644
--- a/src/leap/bitmask/gui/login.py
+++ b/src/leap/bitmask/gui/login.py
@@ -24,6 +24,7 @@ from ui_login import Ui_LoginWidget
from leap.bitmask.config import flags
from leap.bitmask.util import make_address
+from leap.bitmask.util.credentials import USERNAME_REGEX
from leap.bitmask.util.keyring_helpers import has_keyring
from leap.bitmask.util.keyring_helpers import get_keyring
from leap.common.check import leap_assert_type
@@ -48,8 +49,6 @@ class LoginWidget(QtGui.QWidget):
MAX_STATUS_WIDTH = 40
- BARE_USERNAME_REGEX = r"^[A-Za-z\d_]+$"
-
# Keyring
KEYRING_KEY = "bitmask"
@@ -87,7 +86,7 @@ class LoginWidget(QtGui.QWidget):
self.ui.btnLogout.clicked.connect(
self.logout)
- username_re = QtCore.QRegExp(self.BARE_USERNAME_REGEX)
+ username_re = QtCore.QRegExp(USERNAME_REGEX)
self.ui.lnUser.setValidator(
QtGui.QRegExpValidator(username_re, self))