Automattic / simplenote-android

Simplenote for Android
https://simplenote.com
GNU General Public License v2.0
1.78k stars 301 forks source link

[Auth] Update magic links for the new complete login update. #1668

Closed notandyvee closed 3 months ago

notandyvee commented 3 months ago

Fix

This PR makes some updates related to the magic link flow.

Test

Login with Wordpress

The main reason to test this is because I update the deprecated onActivityForResult. It was just easier to handle it in the fragment.

Login With Magic Link

Login With Magic Link Code

Release

No Additional release update needed.

dangermattic commented 3 months ago
2 Warnings
:warning: strings.xml files should only be updated on release branches, when the translations are downloaded by our automation.
:warning: This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by :no_entry_sign: Danger

wpmobilebot commented 3 months ago

📲 You can test the changes from this Pull Request in Simplenote Android by scanning the QR code below to install the corresponding build.

App Name Simplenote Android
Build TypeDebug
Commit97c6124660952d7d1148f1b17730336b52e0f02f
Direct Downloadsimplenote-android-prototype-build-pr1668-97c6124-0190ec87-362e-41fc-b161-5c361c5f9aa4.apk
khaykov commented 3 months ago

Just a heads up - I tested with a regular, non cursed account, and both magic links and code work as expected. So I think we can ignore the "going to back to title screen after entering code" issue.

notandyvee commented 3 months ago

@roundhill I did everything except:

Also one more nice thing iOS does is not require you to enter your email again if you select Enter password:

There may be changes that need to be made with simperium. I'll confirm. So either way best to wait until we discuss this.

@khaykov ready for re-review. After your thorough review I found some small general fragment issues and viewmodel issues. I also updated some of the error messages. Again, keep in mind we have to balance security vs transparency here.

khaykov commented 3 months ago

@notandyvee Thanks for the changes! I found one issue - when opening magic link, the app "closes" after logging you in: 982fa3ba0a64a84049203b259cc63e24

notandyvee commented 3 months ago

Thanks @khaykov . I'll investigate. The reason this is happening seems to be related to a bug I was fixing. Originally I would call Simplenote#loginWithToken and start NotesActivity. But doing so caused two NoteActivitys to pop up. During my testing it worked. But maybe I missed something.

notandyvee commented 3 months ago

Hey @khaykov , so I think I fixed it. If you want to re-test. Idky since simperium is a bit of a black box for me. But I was able to reproduce what you encountered. The change I made should fix it. Let me know if you run into any problems.

notandyvee commented 3 months ago

@roundhill changes requested made and and also fixed the issue with the code confirmation. Not sure what happened.

lol. sorry. Missed your message.