Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Handle user canceled "error" in demo app#762

Merged
mokagio merged 3 commits into
trunkfrom
mokagio/fix-demo-app-crash
Mar 29, 2023
Merged

Handle user canceled "error" in demo app#762
mokagio merged 3 commits into
trunkfrom
mokagio/fix-demo-app-crash

Conversation

@mokagio

@mokagio mokagio commented Mar 27, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@crazytonyli crazytonyli left a comment

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants