metabolist / metatext

A free, open-source iOS Mastodon client.
https://metabolist.org/metatext
GNU General Public License v3.0
727 stars 102 forks source link

Edit Profile and Account Settings may open wrong account if you have several on the same server #143

Open VyrCossont opened 2 years ago

VyrCossont commented 2 years ago

Describe the bug The Edit Profile and Account Settings links that were just added may open the wrong account if you have several on the same server and have already logged into one. This is additionally affected by what account you are logged into in Safari.

To Reproduce

  1. Log into two or more accounts on the same Mastodon instance.
  2. Switch to one of those accounts.
  3. Open the menu by tapping the profile icon in the upper left.
  4. Tap Edit Profile or Account Settings.
  5. You will get a modal dialog: "Metatext wants to log in with ."
  6. Tap Continue.
  7. If you are already logged into an account in Safari, the Mastodon web UI for editing a profile or account settings will appear.
  8. It may not be the same account that is active in Metatext!

Expected behavior The web views for Edit Profile and Account Settings should have their own cookie store per account in Metatext, so that I can log into the Mastodon web UI once per account inside Metatext, and then be able to open the correct Mastodon web UI for that account.

Screenshots If applicable, add screenshots to help explain your problem.

(please complete the following information):

Additional context I suspect this is because the web view shares cookies with Safari. (Apologies for the vagueness, I'm not sure which web view Metatext is using yet, still catching up on the codebase.) Isolating from Safari and using a per-account cookie store means that the user will always have to log in once per account in Metatext, even if they are already logged in in Safari, but means that they will get the correct account.

Multiple accounts on the same server are common for power users, especially admins.

jzzocc commented 2 years ago

Profile editing will eventually move to a native UI, which should solve this