File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
app/src/main/java/org/fossasia/openevent/general/auth Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ import org.fossasia.openevent.general.ticket.TICKETS_FRAGMENT
48
48
import org.jetbrains.anko.design.longSnackbar
49
49
import org.jetbrains.anko.design.snackbar
50
50
51
+ private const val MINIMUM_PASSWORD_LENGTH = 8
52
+
51
53
class SignUpFragment : Fragment () {
52
54
53
55
private val signUpViewModel by viewModel<SignUpViewModel >()
@@ -133,8 +135,7 @@ class SignUpFragment : Fragment() {
133
135
signUp.password = passwordSignUp.text.toString()
134
136
signUp.firstName = firstNameText.text.toString()
135
137
signUp.lastName = lastNameText.text.toString()
136
- confirmPassword = confirmPasswords.text.toString()
137
- signUpViewModel.signUp(signUp, confirmPassword)
138
+ signUpViewModel.signUp(signUp)
138
139
}
139
140
}
140
141
@@ -229,7 +230,7 @@ class SignUpFragment : Fragment() {
229
230
textInputLayoutPassword.isEndIconVisible = true
230
231
}
231
232
232
- if (passwordSignUp.text.toString().length >= 6 ) {
233
+ if (passwordSignUp.text.toString().length >= MINIMUM_PASSWORD_LENGTH ) {
233
234
textInputLayoutPassword.error = null
234
235
textInputLayoutPassword.isErrorEnabled = false
235
236
} else {
Original file line number Diff line number Diff line change @@ -38,10 +38,8 @@ class SignUpViewModel(
38
38
var email: String? = null
39
39
var password: String? = null
40
40
41
- fun signUp (signUp : SignUp , confirmPassword : String ) {
41
+ fun signUp (signUp : SignUp ) {
42
42
if (! isConnected()) return
43
- email = signUp.email
44
- password = signUp.password
45
43
46
44
compositeDisposable + = authService.signUp(signUp)
47
45
.withDefaultSchedulers()
You can’t perform that action at this time.
0 commit comments