#11 explain SCRAM proof mismatches and make the password visible
- Translate Prosody's "doesn't match the one we calculated" SCRAM failure into an actionable Russian message pointing at the typed password, since the client math itself is verified against the RFC 5802 test vector. - Set explicit username/password text content types on the login screen, disable smart text features, and add a password visibility toggle so users can verify what they submit. - Cover the mapping with a unit test and verify.sh invariants.
This commit is contained in:
1 parent
496ee6f0f2
commit
33702420a0
4 files changed
+53
-1
No files matched your search
@@ -4,6 +4,7 @@ struct LoginView: View {
|
||||
@ObservedObject var model: AppModel
|
||||
@State private var jid = ""
|
||||
@State private var password = ""
|
||||
@State private var passwordVisible = false
|
||||
@State private var displayName = ""
|
||||
@State private var resource = ""
|
||||
@State private var showAdvanced = false
|
||||
@@ -79,6 +80,9 @@ struct LoginView: View {
|
||||
#if os(iOS)
|
||||
.keyboardType(.emailAddress)
|
||||
#endif
|
||||
.textContentType(.username)
|
||||
.textInputAutocapitalization(.never)
|
||||
.autocorrectionDisabled()
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.disableAutocorrection(true)
|
||||
}
|
||||
@@ -86,8 +90,29 @@ struct LoginView: View {
|
||||
VStack(alignment: .leading, spacing: 7) {
|
||||
Text("Пароль")
|
||||
.font(.headline)
|
||||
SecureField("Пароль", text: $password)
|
||||
HStack(spacing: 8) {
|
||||
Group {
|
||||
if passwordVisible {
|
||||
TextField("Пароль", text: $password)
|
||||
.textContentType(.oneTimeCode)
|
||||
} else {
|
||||
SecureField("Пароль", text: $password)
|
||||
.textContentType(.password)
|
||||
}
|
||||
}
|
||||
.autocorrectionDisabled()
|
||||
.textInputAutocapitalization(.never)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
|
||||
Button {
|
||||
passwordVisible.toggle()
|
||||
} label: {
|
||||
Image(systemName: passwordVisible ? "eye.slash.fill" : "eye.fill")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel(passwordVisible ? "Скрыть пароль" : "Показать пароль")
|
||||
}
|
||||
}
|
||||
|
||||
DisclosureGroup("Дополнительные настройки", isExpanded: $showAdvanced) {
|
||||
|
||||
Reference in new issue
Block a user