freeCodeCamp / mail-for-good

An open source email campaign management tool for nonprofits
BSD 3-Clause "New" or "Revised" License
3.83k stars 476 forks source link

Fix/login page redirects to main when authenticated #273

Closed HassanAli321 closed 6 years ago

HassanAli321 commented 6 years ago

Please check this pr and let me know there is anything to change

zhakk-harn commented 6 years ago

Hi @HassanAli321 , Thank you for making your first PR to mail for good.

I do have two questions : -Do we really need to add 27k lines of code to make your solution work? -Why do you propose clearing the cache and store of a non-authenticated user queries the login page? If the user isn't authenticated wouldn't there be nothing to clear anyway?

HassanAli321 commented 6 years ago

i don't know why there is 27k line of code change there is may be some mistake i just only change 5 to 6 lines

HassanAli321 commented 6 years ago

I think this is the quick fix for the time because i see an issue in which you said that the whole user login flow needs to refactor from google login to simple email password is it right ?

zhakk-harn commented 6 years ago

This is not a quick fix. You are using a function provided by passport.js to check if the user is logged or not. This function is independent of the used strategy so this will be working before and after the change of flow/strategy.

edit: deleted the first paragraph as I understood what you meant after rephrasing it.

AndrewWalsh commented 6 years ago

Hey @HassanAli321,

Thanks for your effort with this PR. Your commit log contains commits that are behind the current head, so we won't be able to merge this. Could you rebase your changes on top of the master branch? Thanks.