Merge branch 'master' of ssh://bitbucket.org/yackob03/quay
This commit is contained in:
commit
d5bbea9fb2
3 changed files with 5 additions and 6 deletions
|
@ -439,9 +439,9 @@ def get_matching_users(username_prefix, robot_namespace=None,
|
||||||
return (MatchingUserResult(*args) for args in query.tuples().limit(10))
|
return (MatchingUserResult(*args) for args in query.tuples().limit(10))
|
||||||
|
|
||||||
|
|
||||||
def verify_user(username, password):
|
def verify_user(username_or_email, password):
|
||||||
try:
|
try:
|
||||||
fetched = User.get(User.username == username)
|
fetched = User.get((User.username == username_or_email) | (User.email == username_or_email))
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -312,12 +312,11 @@ def signin_user():
|
||||||
return conduct_signin(username, password)
|
return conduct_signin(username, password)
|
||||||
|
|
||||||
|
|
||||||
def conduct_signin(username, password):
|
def conduct_signin(username_or_email, password):
|
||||||
#TODO Allow email login
|
|
||||||
needs_email_verification = False
|
needs_email_verification = False
|
||||||
invalid_credentials = False
|
invalid_credentials = False
|
||||||
|
|
||||||
verified = model.verify_user(username, password)
|
verified = model.verify_user(username_or_email, password)
|
||||||
if verified:
|
if verified:
|
||||||
if common_login(verified):
|
if common_login(verified):
|
||||||
return make_response('Success', 200)
|
return make_response('Success', 200)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="signin-form-element">
|
<div class="signin-form-element">
|
||||||
<form class="form-signin" ng-submit="signin();">
|
<form class="form-signin" ng-submit="signin();">
|
||||||
<input type="text" class="form-control input-lg" name="username"
|
<input type="text" class="form-control input-lg" name="username"
|
||||||
placeholder="Username" ng-model="user.username" autofocus>
|
placeholder="Username or E-mail Address" ng-model="user.username" autofocus>
|
||||||
<input type="password" class="form-control input-lg" name="password"
|
<input type="password" class="form-control input-lg" name="password"
|
||||||
placeholder="Password" ng-model="user.password">
|
placeholder="Password" ng-model="user.password">
|
||||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign In</button>
|
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign In</button>
|
||||||
|
|
Reference in a new issue