loopandlearn / LoopFollow

A general Follow app for parents of T1D Loop Users
GNU Affero General Public License v3.0
106 stars 569 forks source link

Add support for pasting URL with token to populate both fields #290

Closed bjorkert closed 5 months ago

bjorkert commented 5 months ago

Summary

This PR enhances the SettingsViewController by allowing users to paste a URL that includes a token, automatically populating both the URL and token fields. This improvement aims to streamline the testing process.

Changes

  1. New functionality:
    • Added support for handling URLs with embedded tokens.
    • Automatically extracts and populates the token if found.
    • Cleans up the URL accordingly.
  2. Code refactoring:
    • Improved URL filtering and normalization logic.
    • Removed redundant code and improved formatting.

Testing

  1. Manual Testing:
    • Verified that pasting a URL with a token correctly populates the fields.
    • Ensured that normal URL input behavior remains unchanged.
  2. Automated Testing:
    • Added relevant unit tests for the new functionality.

Notes

This update primarily facilitates easier testing scenarios where tokens are used in the URL. It should not affect normal usage but enhances the workflow for testers and developers.

marionbarker commented 5 months ago

Tested both in the way @bjorkert intended plus added a password in my Apple Keychain. That worked as well. Create a new password by typing + in the password tool and give it a name (e.g., LF for NS 1) and then add:

  1. website (see notes below)
  2. username (This is your URL without the token, e.g., https://yoursite.nightscout.com)
  3. password (This is your token, it only needs the alpha numeric string after the hyphen - the descriptive text before that is optional)

Hints about the website: