public IObservable<AuthenticationResult> LogInFromCache()
{
return GetUserFromApi()
.ObserveOn(RxApp.MainThreadScheduler)
.Catch<UserAndScopes, Exception>(ex =>
{
if (ex is AuthorizationException)
{
log.Warn("Got an authorization exception", ex);
}
return Observable.Return<UserAndScopes>(null);
})
.SelectMany(LoginWithApiUser)
.PublishAsync();
}