Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

bbirman
Copy link
Member

@bbirman bbirman commented Jun 25, 2024

No description provided.

@@ -78,6 +78,13 @@ typedef NS_ENUM(NSInteger, SFLogoutReason) {
SFLogoutReasonRefreshTokenRotated // "Refresh token rotated"
};

typedef NS_ENUM(NSInteger, SFLoginReason) {
SFLoginReasonUnknown,
Copy link
Member Author

@bbirman bbirman Jun 25, 2024

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

@bbirman bbirman changed the title Login logging Auth view notification with login reason Jun 25, 2024
@@ -78,6 +78,13 @@ typedef NS_ENUM(NSInteger, SFLogoutReason) {
SFLogoutReasonRefreshTokenRotated // "Refresh token rotated"
};

typedef NS_ENUM(NSInteger, SFLoginReason) {
SFLoginReasonUnknown,
SFLoginReasonRestAPI,
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Member Author

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

[[SFUserAccountManager sharedInstance] loginWithCompletion:^(SFOAuthInfo *authInfo, SFUserAccount *userAccount) {

Copy link
Member Author

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

Copy link
Contributor

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)};
Copy link
Contributor

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

@bbirman bbirman closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants