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

Handle user canceled "error" in demo app #762

Merged
merged 3 commits into from
Mar 29, 2023
Merged

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Mar 27, 2023

While working on #761, I realized the demo app would crash when canceling ("Cancel" button) the web login.

This fixes it.

Testing

I verified this by running the app and pressing the "Cancel" button 😅


  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

Comment on lines 100 to 102
} catch let error as NSError where
error.domain == ASWebAuthenticationSessionError.errorDomain
&& error.code == ASWebAuthenticationSessionError.Code.canceledLogin.rawValue {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I you ask Xcode, it will indent this as:

            } catch let error as NSError where
                        error.domain == ASWebAuthenticationSessionError.errorDomain
                        && error.code == ASWebAuthenticationSessionError.Code.canceledLogin.rawValue {

That doesn't make any sense to me, so I updated it manually.

@mokagio mokagio requested a review from crazytonyli March 28, 2023 04:59
Copy link
Contributor

@crazytonyli crazytonyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@mokagio mokagio merged commit 8aba8c4 into trunk Mar 29, 2023
@mokagio mokagio deleted the mokagio/fix-demo-app-crash branch March 29, 2023 11:05
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.

2 participants