Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun requestLogout(): Single<LogoutType> {
- return networkHelper.isInternetAvailable()
- .flatMap { internetAvailable ->
- if (internetAvailable) {
- if (isLoggedInWithBrowser) {
- Single.just(LogoutType.WITH_BROWSER)
- } else {
- baseServerApi.navigatorLogout()
- .andThen(ssoApi.logout())
- .toSingle { LogoutType.WITH_API }
- .subscribeOn(Schedulers.io())
- }
- } else {
- Single.just(LogoutType.NO_NETWORK)
- }
- }
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- }
- @GET(LOGOUT_ENDPOINT)
- fun navigatorLogout(): Completable where const val LOGOUT_ENDPOINT = "backapi/logout" and prefix SERVER_BASE_URL = "https://msp.everpoint.ru/";
- @GET("/cas/logout")
- fun logout(): Completable and prefix SSO_BASE_URL = "https://ssodev.smbn.ru/cas/";
- //debug
- buildConfigField "String", "SERVER_BASE_URL", '"https://msp.everpoint.ru/"'
- buildConfigField "String", "PORTAL_BASE_URL", '"https://portaldev.smbn.ru/"'
- buildConfigField "String", "SSO_BASE_URL", '"https://ssodev.smbn.ru/cas/"'
- buildConfigField "String", "SSO_CLIENT_ID", '"bndev"'
- //normal
- buildConfigField "String", "SERVER_BASE_URL", '"https://navigator.smbn.ru/"'
- buildConfigField "String", "PORTAL_BASE_URL", '"https://smbn.ru/"'
- buildConfigField "String", "SSO_BASE_URL", '"https://sso.smbn.ru/cas/"'
- buildConfigField "String", "SSO_CLIENT_ID", '"bn"'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement