Skip to content

Commit 2b39b06

Browse files
liveHarshitiamareebjamal
authored andcommitted
fix: Sign Up not working (#1889)
1 parent b03e4ad commit 2b39b06

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

app/src/main/java/org/fossasia/openevent/general/auth/SignUpFragment.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ import org.fossasia.openevent.general.ticket.TICKETS_FRAGMENT
4848
import org.jetbrains.anko.design.longSnackbar
4949
import org.jetbrains.anko.design.snackbar
5050

51+
private const val MINIMUM_PASSWORD_LENGTH = 8
52+
5153
class SignUpFragment : Fragment() {
5254

5355
private val signUpViewModel by viewModel<SignUpViewModel>()
@@ -133,8 +135,7 @@ class SignUpFragment : Fragment() {
133135
signUp.password = passwordSignUp.text.toString()
134136
signUp.firstName = firstNameText.text.toString()
135137
signUp.lastName = lastNameText.text.toString()
136-
confirmPassword = confirmPasswords.text.toString()
137-
signUpViewModel.signUp(signUp, confirmPassword)
138+
signUpViewModel.signUp(signUp)
138139
}
139140
}
140141

@@ -229,7 +230,7 @@ class SignUpFragment : Fragment() {
229230
textInputLayoutPassword.isEndIconVisible = true
230231
}
231232

232-
if (passwordSignUp.text.toString().length >= 6) {
233+
if (passwordSignUp.text.toString().length >= MINIMUM_PASSWORD_LENGTH) {
233234
textInputLayoutPassword.error = null
234235
textInputLayoutPassword.isErrorEnabled = false
235236
} else {

app/src/main/java/org/fossasia/openevent/general/auth/SignUpViewModel.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ class SignUpViewModel(
3838
var email: String? = null
3939
var password: String? = null
4040

41-
fun signUp(signUp: SignUp, confirmPassword: String) {
41+
fun signUp(signUp: SignUp) {
4242
if (!isConnected()) return
43-
email = signUp.email
44-
password = signUp.password
4543

4644
compositeDisposable += authService.signUp(signUp)
4745
.withDefaultSchedulers()

0 commit comments

Comments
 (0)