stytchauth / stytch-ios

MIT License
31 stars 5 forks source link

Stytch UI Exploration #271

Closed nidal-stytch closed 2 months ago

nidal-stytch commented 2 months ago

Linear Ticket: SDK-1861 - [iOS] iOS SDK UI Friction Log

As part of the exploration in understanding of the StytchUI I have moved the code into logical groups and some code into new files, overall minimal changes and additions have been made but I feel that it makes the code much more readable and understandable.

Changes:

  1. Add the proper Stytch fonts to the SDK and load them.
  2. Add a configure method to the StytchUIClient as a global entry point for use, this will call StytchClient.configure and give us a place to do set up operations like loading the fonts. Also added as a param the configuration needed for the UI and removed it from each use of the StytchUIClient.
  3. Rework the UI sample app to add some added functionality such as url handling for authentication via a magic link and logging out.
  4. Discovered a bug in SessionStorage where we were calling _onAuthChange.send(()) in reset() before clearing the session tokens which was publishing an event with a valid session token and then clearing the token.
  5. Remove the use the configuration plist file as we move to force people to call configure.

Checklist: