diff --git a/Twigs/LoginView.swift b/Twigs/LoginView.swift index 752c528..5e49317 100644 --- a/Twigs/LoginView.swift +++ b/Twigs/LoginView.swift @@ -44,6 +44,11 @@ struct LoginView: View { .textFieldStyle(RoundedBorderTextFieldStyle()) .textContentType(UITextContentType.password) .textContentType(.password) + .onSubmit { + Task { + await self.dataStore.login(username: self.username, password: self.password) + } + } Button("action_login", action: { Task { await self.dataStore.login(username: self.username, password: self.password) diff --git a/Twigs/RegistrationView.swift b/Twigs/RegistrationView.swift index d85941e..df5c462 100644 --- a/Twigs/RegistrationView.swift +++ b/Twigs/RegistrationView.swift @@ -34,6 +34,16 @@ struct RegistrationView: View { SecureField("prompt_confirm_password", text: self.$confirmedPassword) .textFieldStyle(RoundedBorderTextFieldStyle()) .textContentType(UITextContentType.newPassword) + .onSubmit { + Task { + await self.dataStore.register( + username: self.username, + email: self.email, + password: self.password, + confirmPassword: self.confirmedPassword + ) + } + } Button("action_register", action: { Task { await self.dataStore.register(