Skip to content

Commit

Permalink
Login issue in all Verticals issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
suhasnowfloats committed May 12, 2023
1 parent 715794e commit edd8c3d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ object WithFloatTwoRepository : AppBaseRepository<WithFloatTwoRemoteData, AppBas
return makeRemoteRequest(remoteDataSource.verifyUserProfile(request), TaskCode.VERIFY_USER_PROFILE)
}

fun verifyUserProfileVertical(request: UserProfileVerificationRequest): Observable<BaseResponse> {
return makeRemoteRequest(remoteDataSource.verifyUserProfileVertical(request), TaskCode.VERIFY_USER_PROFILE)
}

fun forgotPassword(request: ForgotPassRequest): Observable<BaseResponse> {
return makeRemoteRequest(remoteDataSource.forgotPassword(request), TaskCode.FORGOT_PASSWORD)
}
Expand Down Expand Up @@ -110,10 +114,6 @@ object WithFloatTwoRepository : AppBaseRepository<WithFloatTwoRemoteData, AppBas
return makeRemoteRequest(remoteDataSource.verifyLoginOtpVertical(number, otp, clientId = clientId), TaskCode.VERIFY_LOGIN_OTP)
}

fun verifyUserProfileVertical(request: UserProfileVerificationRequest): Observable<BaseResponse> {
return makeRemoteRequest(remoteDataSource.verifyUserProfileVertical(request), TaskCode.VERIFY_USER_PROFILE)
}

fun getVerticalCategories(appExperienceCode: String?): Observable<BaseResponse> {
return makeRemoteRequest(remoteDataSource.getVerticalCategories(appExperienceCode), TaskCode.GET_VERTICAL_CATEGORIES)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ interface WithFloatTwoRemoteData {
@POST(EndPoints.VERIFY_LOGIN)
fun verifyUserProfile(@Body userProfileVerificationRequest: UserProfileVerificationRequest): Observable<Response<VerificationRequestResult>>

@Headers("Content-Type: application/json")
@POST(EndPoints.VERTICAL_VERIFY_LOGIN)
fun verifyUserProfileVertical(@Body userProfileVerificationRequest: UserProfileVerificationRequest): Observable<Response<VerificationRequestResultV3>>

@Headers("Content-Type: application/json")
@POST(EndPoints.FORGET_PASSWORD)
fun forgotPassword(@Body request: ForgotPassRequest): Observable<Response<ResponseBody>>
Expand Down Expand Up @@ -115,10 +119,6 @@ interface WithFloatTwoRemoteData {
@Query(value = "clientId") clientId: String?,
): Observable<Response<VerifyOtpResponse>>

@Headers("Content-Type: application/json")
@POST(EndPoints.VERTICAL_VERIFY_LOGIN)
fun verifyUserProfileVertical(@Body userProfileVerificationRequest: UserProfileVerificationRequest): Observable<Response<VerificationRequestResultV3>>

@GET(EndPoints.GET_VERTICAL_CATEGORIES)
fun getVerticalCategories(
@Path("appExperienceCode") appECode: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,27 @@ class LoginFragment : AuthBaseFragment<FragmentLoginBinding>() {

verifyUsernamePassword?.observeOnce(viewLifecycleOwner) {
hideProgress()
val response: VerificationRequestResult = if (BuildConfig.FLAVOR.equals("partone") || BuildConfig.FLAVOR.equals("jioonline")) (it as? VerificationRequestResult)!! else (it as? VerificationRequestResultV3)!!.result!!
if ((BuildConfig.FLAVOR.equals("partone") || BuildConfig.FLAVOR.equals("jioonline")).not()) {
//set status from statusCode
response.status = (it as? VerificationRequestResultV3)!!.StatusCode
}
if (response?.isSuccess() == true && response.loginId.isNullOrEmpty().not() && response.authTokens.isNullOrEmpty().not()) {
try {
val response: VerificationRequestResult? =
if (BuildConfig.FLAVOR.equals("partone") || BuildConfig.FLAVOR.equals("jioonline")) (it as? VerificationRequestResult) else (it as? VerificationRequestResultV3)!!.result
if(response!=null) {
if ((BuildConfig.FLAVOR.equals("partone") || BuildConfig.FLAVOR.equals("jioonline")).not()) {
//set status from statusCode
response.status = (it as? VerificationRequestResultV3)!!.StatusCode
}
if (response?.isSuccess() == true && response.loginId.isNullOrEmpty()
.not() && response.authTokens.isNullOrEmpty().not()
) {
// if(BuildConfig.FLAVOR.equals("boosthealth"))
storeUserDetail(response)
} else {
showShortToast(getString(R.string.ensure_that_the_entered_username_and_password_))
storeUserDetail(response)
} else {
showShortToast(getString(R.string.ensure_that_the_entered_username_and_password_))
}
}else{
showShortToast(getString(R.string.ensure_that_the_entered_username_and_password_))
}
} catch (e: Exception){
e.printStackTrace()
}
}
}
Expand Down

0 comments on commit edd8c3d

Please sign in to comment.