mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
indicate that both username or email can be passed for login
This commit is contained in:
parent
5f130872af
commit
c5b8ff181e
3 changed files with 8 additions and 8 deletions
|
@ -750,9 +750,9 @@ void Menu::loginForCurrentDomain() {
|
|||
QFormLayout* form = new QFormLayout();
|
||||
layout->addLayout(form, 1);
|
||||
|
||||
QLineEdit* usernameLineEdit = new QLineEdit();
|
||||
usernameLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
|
||||
form->addRow("Username:", usernameLineEdit);
|
||||
QLineEdit* loginLineEdit = new QLineEdit();
|
||||
loginLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
|
||||
form->addRow("Login:", loginLineEdit);
|
||||
|
||||
QLineEdit* passwordLineEdit = new QLineEdit();
|
||||
passwordLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
|
||||
|
@ -766,9 +766,9 @@ void Menu::loginForCurrentDomain() {
|
|||
|
||||
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
|
||||
AccountManager::getInstance().requestAccessToken(usernameLineEdit->text(), passwordLineEdit->text());
|
||||
AccountManager::getInstance().requestAccessToken(loginLineEdit->text(), passwordLineEdit->text());
|
||||
}
|
||||
|
||||
sendFakeEnterEvent();
|
||||
|
|
|
@ -96,7 +96,7 @@ bool AccountManager::checkAndSignalForAccessToken() {
|
|||
return hasToken;
|
||||
}
|
||||
|
||||
void AccountManager::requestAccessToken(const QString& username, const QString& password) {
|
||||
void AccountManager::requestAccessToken(const QString& login, const QString& password) {
|
||||
if (_networkAccessManager) {
|
||||
QNetworkRequest request;
|
||||
|
||||
|
@ -105,7 +105,7 @@ void AccountManager::requestAccessToken(const QString& username, const QString&
|
|||
|
||||
QByteArray postData;
|
||||
postData.append("grant_type=password&");
|
||||
postData.append("username=" + username + "&");
|
||||
postData.append("username=" + login + "&");
|
||||
postData.append("password=" + password);
|
||||
|
||||
request.setUrl(grantURL);
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
bool hasValidAccessToken();
|
||||
bool checkAndSignalForAccessToken();
|
||||
|
||||
void requestAccessToken(const QString& username, const QString& password);
|
||||
void requestAccessToken(const QString& login, const QString& password);
|
||||
|
||||
const QString& getUsername() const { return _username; }
|
||||
void setUsername(const QString& username) { _username = username; }
|
||||
|
|
Loading…
Reference in a new issue