Changeset View
Standalone View
src/apps/qml/Login.qml
Show All 29 Lines | |||||
30 | import KDE.Ruqola.LoginMethodModel 1.0 | 30 | import KDE.Ruqola.LoginMethodModel 1.0 | ||
31 | 31 | | |||
32 | Kirigami.Page { | 32 | Kirigami.Page { | ||
33 | id: loginForm | 33 | id: loginForm | ||
34 | 34 | | |||
35 | property QtObject rcAccount | 35 | property QtObject rcAccount | ||
36 | property alias username: usernameField.text; | 36 | property alias username: usernameField.text; | ||
37 | property alias password: passField.text; | 37 | property alias password: passField.text; | ||
38 | property alias twoFactorAuthenticationCode: twoFactorAuthenticationCodeField.text; | ||||
38 | property alias serverUrl: urlField.text; | 39 | property alias serverUrl: urlField.text; | ||
39 | property alias accountName: nameField.text; | 40 | property alias accountName: nameField.text; | ||
40 | 41 | | |||
41 | property string originalAccountName | 42 | property string originalAccountName | ||
42 | signal accepted() | 43 | signal accepted() | ||
43 | 44 | | |||
44 | 45 | | |||
45 | 46 | | |||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 155 | PasswordLineEdit { | |||
156 | width: parent.width | 157 | width: parent.width | ||
157 | onAccepted: { | 158 | onAccepted: { | ||
158 | if (acceptingButton.enabled) { | 159 | if (acceptingButton.enabled) { | ||
159 | acceptingButton.clicked(); | 160 | acceptingButton.clicked(); | ||
160 | } | 161 | } | ||
161 | } | 162 | } | ||
162 | } | 163 | } | ||
163 | 164 | | |||
165 | QQC2.Label { | ||||
166 | id: twoFactorAuthenticationCodeLabel | ||||
167 | | ||||
168 | width: parent.width | ||||
169 | wrapMode: Text.Wrap | ||||
mlaurent: Please add a better i18n : "2FA" is not know by everyone. | |||||
I changed it to You have enabled second factor authentication. Please enter the generated code or a backup code. which is the terminology used within Rocket.Chat's web UI and made the Label red and bold since it's an error message, including line wrapping in case the window is small. The PasswordLineEdit now says Two-factor authentication code or backup code to further clarify that it's not the same as the password. cdywan: I changed it to `You have enabled second factor authentication. Please enter the generated code… | |||||
170 | text: i18n("You have enabled second factor authentication. Please enter the generated code or a backup code.") | ||||
171 | color: Kirigami.Theme.negativeTextColor | ||||
172 | font.bold: true | ||||
173 | visible: rcAccount.loginStatus === DDPClient.LoginCodeRequired | ||||
We need to investigate if there is a settings for inform us that 2FA is enabled on server. I don't want to keep it visible all the time when it's not enabled. mlaurent: We need to investigate if there is a settings for inform us that 2FA is enabled on server.
I… | |||||
We know that 2FA is required to login when login with just the password fails. And this is account-specific, not server-specific. I added a DDPClient.LoginCodeRequired state to distinguish that case and also show a message explaining what happened. cdywan: We know that 2FA is required to login when login with just the password fails. And this is… | |||||
174 | } | ||||
175 | | ||||
176 | PasswordLineEdit { | ||||
177 | id: twoFactorAuthenticationCodeField | ||||
178 | width: parent.width | ||||
179 | placeholderText: i18n("Two-factor authentication code or backup code") | ||||
180 | visible: rcAccount.loginStatus === DDPClient.LoginCodeRequired | ||||
181 | onAccepted: { | ||||
182 | if (acceptingButton.enabled) { | ||||
183 | acceptingButton.clicked(); | ||||
184 | } | ||||
185 | } | ||||
186 | } | ||||
187 | | ||||
164 | Item { | 188 | Item { | ||
165 | id: spacer2 | 189 | id: spacer2 | ||
166 | width: 30 | 190 | width: 30 | ||
167 | height: 30 | 191 | height: 30 | ||
168 | } | 192 | } | ||
169 | 193 | | |||
170 | QQC2.Button { | 194 | QQC2.Button { | ||
171 | id: acceptingButton | 195 | id: acceptingButton | ||
Show All 32 Lines |
Please add a better i18n : "2FA" is not know by everyone.