don't allow loging in using email as username
(actually, just don't allow @ in usernames)
This commit is contained in:
parent
25b3244d6c
commit
3d9d57e0ff
@ -8,6 +8,13 @@ LoginModel::LoginModel():
|
||||
|
||||
void LoginModel::Login(string username, string password)
|
||||
{
|
||||
if (username.find('@') != username.npos)
|
||||
{
|
||||
statusText = "Use your Powder Toy account to log in, not your email. If you don't have a Powder Toy account, you can create one at https://powdertoy.co.uk/Register.html";
|
||||
loginStatus = false;
|
||||
notifyStatusChanged();
|
||||
return;
|
||||
}
|
||||
statusText = "Logging in...";
|
||||
loginStatus = false;
|
||||
notifyStatusChanged();
|
||||
@ -20,9 +27,6 @@ void LoginModel::Login(string username, string password)
|
||||
break;
|
||||
case LoginError:
|
||||
statusText = Client::Ref().GetLastError();
|
||||
size_t banStart = statusText.find(". Ban expire in"); //TODO: temporary, remove this when the ban message is fixed
|
||||
if (banStart != statusText.npos)
|
||||
statusText.replace(banStart, 15, ". Login at http://powdertoy.co.uk in order to see the full ban reason. Ban expires in");
|
||||
break;
|
||||
}
|
||||
notifyStatusChanged();
|
||||
|
@ -93,7 +93,7 @@ void LoginView::OnTryExit(ExitMethod method)
|
||||
void LoginView::NotifyStatusChanged(LoginModel * sender)
|
||||
{
|
||||
if (infoLabel->Visible)
|
||||
targetSize.Y -= infoLabel->Size.Y+2;
|
||||
targetSize.Y = 87;
|
||||
infoLabel->SetText(sender->GetStatusText());
|
||||
infoLabel->AutoHeight();
|
||||
if (sender->GetStatusText().length())
|
||||
|
Reference in New Issue
Block a user