Consolidate login UI and code
See original GitHub issueThis is somewhat related to issue #333 , but should probably be done before anyone starts working on #333, only to make things easier for them.
Description
We currently support 2 ways of logging in:
- By scanning a QR code displayed by another device (CPS = false)
- By clicking on a sqrl link on the Anrdoid device itself (CPS = true)
We have separate UI and logic code for both of those login methods, despite the fact that they are largely identical.
Suggested enhancement
Abandon the login popup window in SimplifiedActivity
and use the UrlLoginActivity
instead also for scanning a QR code. This could be done easily by just starting an intent to launch UrlLoginActivity
after having received the sqrl:// link from the QR code scan:
Intent urlIntent = new Intent(Intent.ACTION_VIEW);
urlIntent.setData(Uri.parse(serverData));
urlIntent.putExtra("EXTRA_USE_CPS", false);
startActivity(urlIntent);
The extra which is put in the intent can be detected in UrlLoginActivity
and CPS could be turned off accodingly.
This would get rid of a lot of redundancy and leave us with only one login codebase to deal with.
What do you guys think?
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (9 by maintainers)
Top GitHub Comments
I hope you enjoy your holidays Alex! I’m going to be away quite a bit of time myself, coming up 17 June through 2 July. I’ll be home some of that time, but mostly away. And Daniel, I didn’t mention it in the other thread, but congratulations on the new nurse! That’s a laudable profession. My mom and nephew are nurses.
Hi @alexhauser
You might be mostly right about that they do the same work except for the CPS part. I think it was the IdentitySelector now that I think of it. But it has been updated and consolidated to a reasonable complexability.
As I said I think the thought of merging these are good so let’s try it. Just keep in mind that we don’t want the code to become more complex. The duplication is not extreme but can we simplify it by merging them then I’m all for it.
Best regards Daniel