StanfordSpezi / SpeziAccount

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

Clearly communicate the supported operations of an AccountKey #18

Open Supereg opened 12 months ago

Supereg commented 12 months ago

Problem

Currently, an AccountKey implementation must always provide DataDisplay and DataEntry views and an implementation has little to know control to specify if it is readOnly, writeOnly (e.g. only supply a verification code at signup) or readWrite (any other possibilities?). For AccountKey of category credential there is, due to the current implementation, a workaround to implement writeOnly account values (see here https://github.com/StanfordSpezi/SpeziAccount/pull/7#discussion_r1312385366). Status properties (like emailVerified) reported from account services also always need to implement a DataEntry view.

Solution

This issue propose a potential solution to this problem by allow to declare DataDisplay and DataEntry types as EmptyViews and adding respective documentation explaining the impact of such. The above-illustrated use cases would be resolved like the following:

Additional context

It might make sense to add @available(*, deprecated, message: "...") annotations to the ConfiguredAccountKey methods if ...

Code of Conduct