Skip to content

feat: Change authentication process and remove navigation (#1749) #1763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2019

Conversation

liveHarshit
Copy link
Member

Fixes #1749
Fixes #1251
Fixes #1762

@auto-label auto-label bot added the feature label May 14, 2019
return rootView
}

private fun redirectToLogin(email: String = "") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this default value?

smartAuthViewModel.isCredentialStored
.nonNull()
.observe(this, Observer {
if (it) redirectToLogin()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikit19 Here no email address is passing, so set its default value to an empty string.

@liveHarshit
Copy link
Member Author

Please review it.

@liveHarshit
Copy link
Member Author

Please review it.

@iamareebjamal

@iamareebjamal
Copy link
Member

@anhanh11001 Please peer review PRs

}

override fun onBackPressed() {
when (currentFragmentId) {
R.id.loginFragment,
R.id.signUpFragment -> {
R.id.authFragment -> {
navController.popBackStack(R.id.eventsFragment, false)
Copy link
Contributor

@anhanh11001 anhanh11001 May 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small problem: this will always pop back to EventsFragment -> So if the user navigate from other fragments like Order or Ticket to log in and somehow they press back button, they will not return to the correct one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have not removed it because imo it make scene. User is redirected to auth fragment where authentication requires, if user cancel the authentication then it should redirect to home screen.
If you want I will remove the condition from auth fragment and navigation flow will work in it's natural way?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think that popping back to EventsFragment is fine in most case, except when a user is booking tickets in AttendeeFragment, canceling logging in will not return them to the current event/ticket detail that they're searching for.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so It will make complex to apply different conditions for different fragments. I will remove it. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other changes you want to suggest?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't. I think the rest is good

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a problem in that case. If the user goes to tickets, redirected to auth fragment. After pressing the back button, the user must redirect to events fragment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal Can we use fragment's navArgs() in Main activity?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it be a problem?

@mariobehling
Copy link
Member

Please resolve conflicts and finalize the PR.

mariobehling
mariobehling previously approved these changes May 18, 2019
@liveHarshit
Copy link
Member Author

Updated

@iamareebjamal iamareebjamal merged commit 4bea92c into fossasia:development May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot continue from the last fragment after authentication Do authentication without using navigation bar App crashes on login/signup
5 participants