Skip to content

Commit

Permalink
Merge pull request #3817 from Crebs/@W-14212091
Browse files Browse the repository at this point in the history
Remove userLogout AILTN event
  • Loading branch information
Crebs authored Jan 28, 2025
2 parents e165e77 + 4a90a3b commit 164ad1a
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ - (void)send:(SFRestRequest *)request requestDelegate:(id<SFRestRequestDelegate>
} failure:^(SFOAuthInfo *authInfo, NSError *error) {
__strong typeof(weakSelf) strongSelf = weakSelf;
[SFSDKCoreLogger e:[strongSelf class] format:@"Authentication failed in SFRestAPI: %@. Logging out.", error];
NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init];
attributes[@"errorCode"] = [NSNumber numberWithInteger:error.code];
attributes[@"errorDescription"] = error.localizedDescription;
[SFSDKEventBuilderHelper createAndStoreEvent:@"userLogout" userAccount:nil className:NSStringFromClass([strongSelf class]) attributes:attributes];
[[SFUserAccountManager sharedInstance] logout:SFLogoutReasonUnexpected];
}];
} else {
Expand Down Expand Up @@ -447,7 +443,6 @@ - (void)replayRequest:(SFRestRequest *)request response:(NSURLResponse *)respons

// Make sure we call logout on the main thread.
dispatch_async(dispatch_get_main_queue(), ^{
[strongSelf createAndStoreLogoutEvent:refreshError user:strongSelf.user];
[[SFUserAccountManager sharedInstance] logoutUser:strongSelf.user reason:SFLogoutReasonTokenExpired];
});
}
Expand Down Expand Up @@ -490,13 +485,6 @@ - (void)notifyDelegateOfFailure:(id<SFRestRequestDelegate>)delegate request:(SFR
[self removeActiveRequestObject:request];
}

- (void)createAndStoreLogoutEvent:(NSError *)error user:(SFUserAccount*)user {
NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init];
attributes[@"errorCode"] = [NSNumber numberWithInteger:error.code];
attributes[@"errorDescription"] = error.localizedDescription;
[SFSDKEventBuilderHelper createAndStoreEvent:@"userLogout" userAccount:user className:NSStringFromClass([self class]) attributes:attributes];
}

#pragma mark - SFRestRequest factory methods

- (SFRestRequest *)requestForUserInfo {
Expand Down

0 comments on commit 164ad1a

Please sign in to comment.