public Observable < BackendUser > getUserFromRecoveryToken ( final String recoveryToken ) { return Observable . create ( new Observable . OnSubscribe < BackendUser > ( ) { @ Override public void call ( Subscriber < ? super BackendUser > subscriber ) { try { setLoginState ( LOGGING_IN ) ; ValidCredentials validCredentials = getWebService ( ) . getUserFromRecoveryToken ( recoveryToken ) . toBlockingObservable ( ) . first ( ) ; if ( validCredentials == null ) throw new Exception ( "Null User Returned" ) ; subscriber . onNext ( setUser ( validCredentials ) ) ; } catch ( Exception e ) { setLoginState ( LOGGED_OUT ) ; subscriber . onError ( e ) ; } } } ) ; }
Login using user recovery token