-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth view notification with login reason #3732
Conversation
@@ -78,6 +78,13 @@ typedef NS_ENUM(NSInteger, SFLogoutReason) { | |||
SFLogoutReasonRefreshTokenRotated // "Refresh token rotated" | |||
}; | |||
|
|||
typedef NS_ENUM(NSInteger, SFLoginReason) { | |||
SFLoginReasonUnknown, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are tbd, I was thinking we should also have something for the AuthHelper entry point since that's only called by apps
@@ -78,6 +78,13 @@ typedef NS_ENUM(NSInteger, SFLogoutReason) { | |||
SFLogoutReasonRefreshTokenRotated // "Refresh token rotated" | |||
}; | |||
|
|||
typedef NS_ENUM(NSInteger, SFLoginReason) { | |||
SFLoginReasonUnknown, | |||
SFLoginReasonRestAPI, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would it be SFLoginReasonRestAPI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed that meant we try to refresh the access token but the auth token is expired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, I missed a file, for this one
SalesforceMobileSDK-iOS/libs/SalesforceSDKCore/SalesforceSDKCore/Classes/RestAPI/SFRestAPI.m
Line 247 in 14df0e9
[[SFUserAccountManager sharedInstance] loginWithCompletion:^(SFOAuthInfo *authInfo, SFUserAccount *userAccount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better naming ideas would be great :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can match the logout reasons when applicable?
[SFSDKCoreLogger i:[self class] format:@"Showing auth view, login reason: %@", reason]; // TODO string value | ||
NSDictionary *userInfo = @{ kSFNotificationUserInfoCredentialsKey: coordinator.credentials, | ||
kSFNotificationUserInfoAuthTypeKey: coordinator.authInfo, | ||
kSFNotificationUserInfoLoginReasonKey: @(coordinator.authSession.oauthRequest.loginReason)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reason should also be applied to the notification posted in the function below - - (void)oauthCoordinator:(SFOAuthCoordinator *)coordinator didBeginAuthenticationWithSession:(ASWebAuthenticationSession *)session
No description provided.