indicate that both username or email can be passed for login

This commit is contained in:
Stephen Birarda 2014-02-19 14:14:17 -08:00
parent 5f130872af
commit c5b8ff181e
3 changed files with 8 additions and 8 deletions

View file

@ -750,9 +750,9 @@ void Menu::loginForCurrentDomain() {
QFormLayout* form = new QFormLayout(); QFormLayout* form = new QFormLayout();
layout->addLayout(form, 1); layout->addLayout(form, 1);
QLineEdit* usernameLineEdit = new QLineEdit(); QLineEdit* loginLineEdit = new QLineEdit();
usernameLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); loginLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
form->addRow("Username:", usernameLineEdit); form->addRow("Login:", loginLineEdit);
QLineEdit* passwordLineEdit = new QLineEdit(); QLineEdit* passwordLineEdit = new QLineEdit();
passwordLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); passwordLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
@ -766,9 +766,9 @@ void Menu::loginForCurrentDomain() {
int dialogReturn = loginDialog.exec(); int dialogReturn = loginDialog.exec();
if (dialogReturn == QDialog::Accepted && !usernameLineEdit->text().isEmpty() && !passwordLineEdit->text().isEmpty()) { if (dialogReturn == QDialog::Accepted && !loginLineEdit->text().isEmpty() && !passwordLineEdit->text().isEmpty()) {
// attempt to get an access token given this username and password // attempt to get an access token given this username and password
AccountManager::getInstance().requestAccessToken(usernameLineEdit->text(), passwordLineEdit->text()); AccountManager::getInstance().requestAccessToken(loginLineEdit->text(), passwordLineEdit->text());
} }
sendFakeEnterEvent(); sendFakeEnterEvent();

View file

@ -96,7 +96,7 @@ bool AccountManager::checkAndSignalForAccessToken() {
return hasToken; return hasToken;
} }
void AccountManager::requestAccessToken(const QString& username, const QString& password) { void AccountManager::requestAccessToken(const QString& login, const QString& password) {
if (_networkAccessManager) { if (_networkAccessManager) {
QNetworkRequest request; QNetworkRequest request;
@ -105,7 +105,7 @@ void AccountManager::requestAccessToken(const QString& username, const QString&
QByteArray postData; QByteArray postData;
postData.append("grant_type=password&"); postData.append("grant_type=password&");
postData.append("username=" + username + "&"); postData.append("username=" + login + "&");
postData.append("password=" + password); postData.append("password=" + password);
request.setUrl(grantURL); request.setUrl(grantURL);

View file

@ -31,7 +31,7 @@ public:
bool hasValidAccessToken(); bool hasValidAccessToken();
bool checkAndSignalForAccessToken(); bool checkAndSignalForAccessToken();
void requestAccessToken(const QString& username, const QString& password); void requestAccessToken(const QString& login, const QString& password);
const QString& getUsername() const { return _username; } const QString& getUsername() const { return _username; }
void setUsername(const QString& username) { _username = username; } void setUsername(const QString& username) { _username = username; }