StanfordSpezi / SpeziAccount

The Spezi Account module to enable login and signup functionality
https://swiftpackageindex.com/StanfordSpezi/SpeziAccount/documentation/
MIT License
6 stars 5 forks source link

`accountRequired` modifier should not consider anonymous accounts by default. #72

Closed Supereg closed 2 months ago

Supereg commented 2 months ago

accountRequired modifier should not consider anonymous accounts by default.

:recycle: Current situation & Problem

Currently, the accountRequired(_:setupSheet:) modifier considers any associated account details as a valid account and therefore dismisses the provided setup sheet. However, typically anonymous accounts are not considered full accounts and are only used to have a persistent account identifier. The AccountSetup sheet treats anonymous accounts similarly where it still shows all the signup options.

This PR introduces a new flag passed to the accountRequired(_:considerAnonymousAccounts:setupSheet:) modifier to control the behavior of anonymous accounts. By default anonymous accounts are treated the same as if no account was present.

:gear: Release Notes

:books: Documentation

Documentation was updated.

:white_check_mark: Testing

--

:pencil: Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.49%. Comparing base (b9c1cb6) to head (ef0f2c8). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...Account/ViewModifier/AccountRequiredModifier.swift 95.24% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72/graphs/tree.svg?width=650&height=150&src=pr&token=AudNwGU7tR&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi)](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) ```diff @@ Coverage Diff @@ ## main #72 +/- ## ========================================== + Coverage 84.47% 84.49% +0.02% ========================================== Files 120 120 Lines 5208 5213 +5 ========================================== + Hits 4399 4404 +5 Misses 809 809 ``` | [Files with missing lines](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) | Coverage Δ | | |---|---|---| | [.../SpeziAccount/Environment/AccountRequiredKey.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?src=pr&el=tree&filepath=Sources%2FSpeziAccount%2FEnvironment%2FAccountRequiredKey.swift&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvRW52aXJvbm1lbnQvQWNjb3VudFJlcXVpcmVkS2V5LnN3aWZ0) | `100.00% <ø> (ø)` | | | [Sources/SpeziAccount/ExternalAccountStorage.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?src=pr&el=tree&filepath=Sources%2FSpeziAccount%2FExternalAccountStorage.swift&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvRXh0ZXJuYWxBY2NvdW50U3RvcmFnZS5zd2lmdA==) | `70.13% <ø> (ø)` | | | [...ces/SpeziAccount/Mock/InMemoryAccountService.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?src=pr&el=tree&filepath=Sources%2FSpeziAccount%2FMock%2FInMemoryAccountService.swift&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvTW9jay9Jbk1lbW9yeUFjY291bnRTZXJ2aWNlLnN3aWZ0) | `89.46% <100.00%> (ø)` | | | [...Account/ViewModifier/AccountRequiredModifier.swift](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?src=pr&el=tree&filepath=Sources%2FSpeziAccount%2FViewModifier%2FAccountRequiredModifier.swift&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi#diff-U291cmNlcy9TcGV6aUFjY291bnQvVmlld01vZGlmaWVyL0FjY291bnRSZXF1aXJlZE1vZGlmaWVyLnN3aWZ0) | `90.39% <95.24%> (+1.03%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Last update [b9c1cb6...ef0f2c8](https://app.codecov.io/gh/StanfordSpezi/SpeziAccount/pull/72?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=StanfordSpezi).
PSchmiedmayer commented 2 months ago

Thank you @Supereg!