//Функция регистрации
fun registration(args: Array<String>) {
compositeDisposable.add(
retofit.registrate(args)
.subscribe({
//User successful registered
//Do auth
authorization(args)
}, {
handleError(it)
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
)
}
//Функция авторизации
fun authorization(args: Array<String>) {
compositeDisposable.add(
retofit.auth(args)
.subscribe({
//User successful auth
//Do work after user auth
userSuccessfulAuth()
}, {
handleError(it)
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
)
}