ngoworldcommunity / NGOWorld

A platform to connect and support NGOs, charities and you to build a better tomorrow.
https://ngoworld.org
MIT License
359 stars 418 forks source link

Bug: Navbar Issue after Logged In #1091

Closed RajBhattacharyya closed 6 months ago

RajBhattacharyya commented 11 months ago

Description

Description:

Screenshots

image image

Browser 🥦

Google Chrome

Checklist ✅

github-actions[bot] commented 11 months ago

Hello @RajBhattacharyya, thank you for raising the issue.

Currently, the issue is marked as https://github.com/MilanCommunity/Milan/labels/%F0%9F%91%B7%F0%9F%8F%BB%E2%80%8D%E2%99%82%EF%B8%8F%20status%3A%20awaiting%20triage which means that work for this issue is on hold and we are waiting for the maintainers/owner to review it and provide you with feedback/suggestions to proceed further.

Feel free to reach out to Tamal on Twitter, or drop a mail at tamalcodes@gmail.com if you think that this issue is of critical priority.

Give us a ⭐ to show some support Happy OpenSource 🚀

Vijaykv5 commented 11 months ago

Hey I would love to work on this issue. May you can assign me under hacktoberfest label

tamalCodes commented 11 months ago

Hey @RajBhattacharyya , thanks for raising the issue. Apologies for the delay that has been made. Can you please take a look at the following recording, that would make you understand what's going on better.

https://www.loom.com/share/e659725c8d0f41069be4613dcaf0ee3d?sid=d9bc167c-bcdf-4612-a540-8d2eb297b4a5

RajBhattacharyya commented 11 months ago

Hello @tamalCodes I have few questions to ask..

  1. We have to update the backend where we'll take the userType input during the Google auth?
  2. If we do so then we have to update the frontend too asking the user to login as individual or clubs...
  3. Or we can just use Google auth for individual only... or club login only?
tamalCodes commented 11 months ago

Take a look here. We are using Passport js to take care of the google authentication, so we need to set up a google auth strategy for the same. We have 2 types of users, and that is the reason why in our account we have a usertype field. Now here's the problem:

We apparently cannot make 2 different strategies for Google auth, nor can we pass proper data to the backend for this case. Therefore we are stuck with the await User.create - meaning whenever anyone creates an account with Google auth, they will be given an user account only. Not a club account.



So as you noticed there is a huge flaw where if I try to make a club account with Google Auth, the register won't work. That is why I have thought of 2 approaches:

As soon as the user logs in with OAuth, we pass a OAuthLoginInitiated cookie from the /google/callback backend route which is checked in the Frontend here, if we have that cookie we call a function which simply calls the /login/success backend route and that route passes the emptyProfile cookie to the Frontend if there is no usertype in the user's data.

What I have thought is to give an option to the user as soon as they would visit their profile, if they would have the emptyProfile cookie we will give them the option to choose which type of account they want and obviously they can't go back if they once choose. So that way it would work.

The next thing is I am trying to find a way if by any means i can have 2 different google Auth strategies or something similar.

RajBhattacharyya commented 11 months ago

Hey @tamalCodes of the 2 approaches you said I think:

  1. First approach, we are letting the user create a incomplete profile first, them we are letting them edit.
  2. Second approach, we are create 2 different AUTH strategies which is not necessary.

How about we do this like this:

  1. When the user click on sign in with google button we first show them a dialog box to select the userType after that auth screen will appear. Along with this extra parameter, we send the data to google as custom inputs

    OR

  2. We create 2 different buttons in the signup page only, one for Individual other for clubs. and same extra parameter will then pass to google auth

tamalCodes commented 11 months ago

That's the problem we are facing. We are unable to send the data to google as custom inputs . If that was possible then this error would have been solved easily too. We can simply configure the buttons to send the usertype - but that is not working.

I would rather be grateful if you could head over to the Milan Backend repo and try if this would work out in any way.

RajBhattacharyya commented 10 months ago

Hey @tamalCodes I opened a issue in backend about this so if you can just look into it once, it will be very helpful

Link- https://github.com/MilanCommunity/Milan-Backend/issues/41

dev0869 commented 8 months ago

Hey I would like to work on this issue.

tamalCodes commented 7 months ago

Go ahead @dev0869 ! Keep me posted with the updates if possible

Vinaysohaliya commented 7 months ago

I would like to work on this issue on 15th Jan, can you assign me.

tamalCodes commented 7 months ago

Hi @Vinaysohaliya this issue is currently https://github.com/milancommunity/Milan/labels/status%3A%20wip%20%F0%9F%91%A9%F0%9F%8F%BB%E2%80%8D%F0%9F%92%BB meaning someone is working on it - I'll wait for a while before I transfer issues !

Vijaykv5 commented 7 months ago

@tamalCodes as per your contribution guidelines, it is first come first basis. I addressed to work on this issue at first you may see earlier comments and you have assigned to someone after that :(

tamalCodes commented 7 months ago

Hi, @Vijaykv5 Yes we do assign issues on a first come first serve basis but do take a look at this cheque box that everyone has to fill whenever they make an issue in this case the author of the original issue has checked that box and was active at that current time that was the reason why I did not assign you the issue back then.

Hope you get the reason as to why you weren't assigned. Anyway, open source is not about competing for different issues rather if you want to go ahead and contribute to our project do take a look at other open issues or raise a new one and I will happily assign you that.

image

Vijaykv5 commented 7 months ago

@tamalCodes Yeah I saw that but I'm talking about after he's unassigned. Like after you unassigned him, it must be the next first one right to be assigned according to repo contributing guideline

I completely agree open source is not about competing, but following a contributing guidelines is also most important in open source.

tamalCodes commented 7 months ago

So here's exactly where things go wrong I do not keep track in that manner of who came after whom and I do assign the issues based on the latest comment or the latest person I see in this case it was not you.

If I had to keep track of who came after whom things would be complicated now imagine a scenario - Where I first assign an issue on September 30th the work then gets started and someone comments in October, or November while the issue is still WIP.

Next, I became inactive and I came back the next year after my health was ok now I try to close all these stale issues because I feel that it is now really complicated to track back into history and cope with the work that is there instead I try and create fresh issues - Now just a week ago I see someone else comment so I went ahead and assign them instead of assigning someone who commented 3 months ago.

Why ?

Because there might be very high chances of that person not being active anymore in this particular thread. So instead of wasting more time on the already delayed issue (4 month long issue in this case) - I go ahead and assign someone relatively new to get the task done.

This is exactly the reason why I said open source is not about competing with issues but rather trying to understand what went along with the maintainer and why they couldn't make it up & collaborate more.

I hope you understand - I'll mark all our comments as off-topic for now.

tamalCodes commented 6 months ago

Notice 🚩

Hi there, unfortunately, I will have to close this Issue/PR, as this issue/PR has been inactive for quite a while and there's no work going on for the same.

There might be more Issues/PR that are waiting for this to be completed - so it is better to pace things up. I generally spend/wait for 3 weeks before marking any issue as stale and closing it.

If you think that this is a mistake, please drop an email at milanhub.org@gmail.com, and we will get back to you.

Regards, Team Milan.