linagora / Twake-Mobile

Twake mobile application
GNU Affero General Public License v3.0
58 stars 27 forks source link

Login > Cannot back to the login screen from Forgot Password screen and Register screen #247

Closed tlle14 closed 3 years ago

tlle14 commented 3 years ago

Precondition

From the login screen

Actual Result

  1. Visited Forgot Password screen, the back button doesn't work https://user-images.githubusercontent.com/69950655/106581346-56657200-6575-11eb-9042-d701df65ff45.mp4

  2. Visited Register screen, when clicking Login button, it redirects to the web Login Page https://user-images.githubusercontent.com/69950655/106581453-76953100-6575-11eb-8fc5-18a2ef237ec3.mp4

Expected Result

When click back button or Login button, it should redirect to the correct Login Screen of the Mobile App

Environment

Both Android and iOS device Build version: twake.2.2.2

bmuddha commented 3 years ago

@RomaricMourgues hi, sorry for bothering you, but can you please point us to the right person, who can adapt/adjust password reset and signup pages for mobile?

RomaricMourgues commented 3 years ago

@tuanlc is the right person to talk to :)

bmuddha commented 3 years ago

Thank you @RomaricMourgues :)

@tuanlc As you can see from the video attached to the issue, we need some rework on password reset and sign up pages, to be precise we need to adapt them in such a way, that they will better fit mobile screens. Also we probably need to remove some buttons or make them do something else so we can detect it from mobile app and handle web button presses in correct way from within the application. It'd be awesome if you guys can create us a separate pages for that. As for the design you can (probably should) consult our designer @BastiaanVanGaalen

tuanlc commented 3 years ago

Hello @bobs4462

I will check ASAP and will keep you posted

tuanlc commented 3 years ago
  1. Visited Forgot Password screen, the back button doesn't work

I confirm this bug and I created an issue. It should be fixed soon.

Visited Register screen, when clicking Login button, it redirects to the web Login Page

I have a question about this. Does the mobile application (native app) have its own login page (but not use web view for login)?

tuanlc commented 3 years ago

Thank you @RomaricMourgues :)

@tuanlc As you can see from the video attached to the issue, we need some rework on password reset and sign up pages, to be precise we need to adapt them in such a way, that they will better fit mobile screens. Also we probably need to remove some buttons or make them do something else so we can detect it from mobile app and handle web button presses in correct way from within the application. It'd be awesome if you guys can create us a separate pages for that. As for the design you can (probably should) consult our designer @BastiaanVanGaalen

We have implemented responsive view for both Desktop and Mobile. For mobile, maybe the current version is not display correctly for you (test)device

Regarding the dedicated view for mobile native application, Can you give me more detailed requirements for the elements, buttons, etc and may be the UI design?

bmuddha commented 3 years ago

I have a question about this. Does the mobile application (native app) have its own login page (but not use web view for login)?

For login yes, the mobile uses native flutter forms, so we have two options here: either we remove login button entirely (user can get back to login screen with back button press) or we redirect user to some special url (just for mobile) so we can detect the redirection from application and swap current screen for native login form.

bmuddha commented 3 years ago

Regarding the dedicated view for mobile native application, Can you give me more detailed requirements for the elements, buttons, etc and may be the UI design?

Our designer will give his opinion on that matter shortly.

tuanlc commented 3 years ago

For login yes, the mobile uses native flutter forms, so we have two options here: either we remove login button entirely (user can get back to login screen with back button press) or we redirect user to some special url (just for mobile) so we can detect the redirection from application and swap current screen for native login form.

Why don't you do that for other pages like signup?

bmuddha commented 3 years ago

Why don't you do that for other pages like signup?

Time, that's the issue, we need to release the app as soon as possible, but there's no way we can implement those new forms fast enough, so as a temporary quick and dirty solution we use web forms for now.

tuanlc commented 3 years ago

Time, that's the issue, we need to release the app as soon as possible, but there's no way we can implement those new forms fast enough, so as a temporary quick and dirty solution we use web forms for now.

And you push that for the web team by implementing dedicated views for naive mobile application :trollface:

bmuddha commented 3 years ago

Well, that's awkward :). I thought maybe you just copy existing pages, make some minor adjustments and that's it. And if that's not the case let's leave the current pages, but we still need some modifications regarding the button press behavior (they should do something specific, so that we can recognize from the app, for example open a specific url).

tuanlc commented 3 years ago

but we still need some modifications regarding the button press behavior (they should do something specific, so that we can recognize from the app, for example open a specific URL).

Can you explain more? What buttons and what is your expected behavior?

bmuddha commented 3 years ago

Screenshot_1612344082.jpg On this page the back button should navigate to some particular url, which will have distinct keyword in it, currently it does nothing.

On sign in page it opens https://auth.twake.app/oauth2/authorize?response_type=code&redirect_uri=https%3A%2F%2Fbeta.twake.app%2Fajax%2Fusers%2Fconsole%2Fopenid&client_id=twake&nonce=586131d6cec3c1b2d0288da8b48fa1dd&state=58948f538a7911383e3ede96f02382b5&scope=openid+email+profile+address+phone+openid

this link first, and after clicking sign in button

Screenshot_1612344082.jpg

it takes you to https://auth.twake.app/oauth2/authorize?client_id=twakeconsole&redirect_uri=https%3A%2F%2Fconsole.twake.app%2Foidccallback&response_type=code&scope=openid%20profile%20email%20address%20phone%20offline_access&state=b13296f2c1124ca782db0c2830872451&code_challenge=08rOhvVhpl4sDwpyv7CP5p5SUeMagsht2RMc9aYmmtE&code_challenge_method=S256&response_mode=query

which is not really helpful at figuring out that we are at sign in page now, what we expect is that url will change to something like https://auth.twake.app/oauth2/authorize?signin=true...., so that we can open flutter form once we detected the navigation to this url.

tuanlc commented 3 years ago

FYI, We are fixing the bug for Back button in the recover password screen to back to login page.

Regarding your request to have a signature (signin=true) that allows the mobile native application to detect and to navigate users properly, it is out of our scope since the URL is decided by lemonldap.

Fortunately, there are some signatures in the signing URL that you can use:

  1. Contains authorize
  2. Contains response_type=code
  3. Contains code_challenge and code_challenge_method

1, 2/ and 3/ are first steps in PKCE flow when client signing by using OIDC)

bmuddha commented 3 years ago

Alright, thank you @tuanlc, I'll try to make use of those signatures then. Can you please give me time estimates when back button in recover password screen will be ready?

tuanlc commented 3 years ago

Alright, thank you @tuanlc, I'll try to make use of those signatures then. Can you please give me time estimates when back button in recover password screen will be ready?

Which platform are you asking for? Pre-prod (console.qa.twake.app) or prod (console.twake.app)?

bmuddha commented 3 years ago

Which platform are you asking for? Pre-prod (console.qa.twake.app) or prod (console.twake.app)?

We are using prod now - console.twake.app

tuanlc commented 3 years ago

We are using prod now - console.twake.app

The issue was fixed and deployed to production. You can test now.

Good luck!

bmuddha commented 3 years ago

Thank you @tuanlc, I managed to correctly detect sign in attempts from register screen and was able to handle that event correctly.

But the issue with password recovery page still persists in other form untitled.gif

The problem is that, if you happen to open password recovery link directly (as we do), you cannot go back, because there's no routes in navigation history to go to. Is it possible to go back to somewhere like back to login screen for example?

tuanlc commented 3 years ago

The problem is that, if you happen to open password recovery link directly (as we do), you cannot go back, because there's no routes in navigation history to go to. Is it possible to go back to somewhere like back to login screen for example?

I got your point. I created a ticket for it. https://ci.linagora.com/linagora/lgs/saas/portal/twake-console-web/issues/205

tlle14 commented 3 years ago

Thank all, Retest pass! https://images.zenhubusercontent.com/309637937/686f4faa-886d-4aaf-9a50-14a898151a22/videobeda5aa0_8be0_4555_9bdc_7a74fffd2d8evideo.mp4