Skip to content

Commit 5da2698

Browse files
fix: trim whitespace and newlines from access url and token textfields (#207)
Prevents scenarios like the following, where newlines are pasted in by accident: <img width="555" height="246" alt="image" src="https://github.com/user-attachments/assets/5f473dd4-dc11-4a28-a3b2-9e7bc57d033f" /> The Windows app has trimming in the same places.
1 parent faaa0af commit 5da2698

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Coder-Desktop/Coder-Desktop/Views/LoginForm.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct LoginForm: View {
5858

5959
func submit() async {
6060
loginError = nil
61+
sessionToken = sessionToken.trimmingCharacters(in: .whitespacesAndNewlines)
6162
guard sessionToken != "" else {
6263
return
6364
}
@@ -164,6 +165,7 @@ struct LoginForm: View {
164165
}
165166

166167
private func next() {
168+
baseAccessURL = baseAccessURL.trimmingCharacters(in: .whitespacesAndNewlines)
167169
guard baseAccessURL != "" else {
168170
return
169171
}

0 commit comments

Comments
 (0)