devlarabar / 100freelancers

100freelancers is a tool to keep track of freelance clients. It is a community, open-source project in the early stages of development.
https://100freelancers.vercel.app
MIT License
15 stars 11 forks source link

Bug/discord auth bug #8

Closed AhmedHHamdy closed 11 months ago

AhmedHHamdy commented 11 months ago

The issue I think occurs when Discord callback sends the signed user to /home right away, the auth context won't get updated right away. That results in the user being null and isAuthenticated being "unauthenticated"

So I fixed the Spinner Component, Now it will work when the user signs in but waiting for authContext to provide a confirmation Also, I fixed the auth?.isAuthenticated() == "unauthenticated" to get the proper value to compare it with the string "unauthenticated"

This should fix the bug, When the user signs in, there should be a spinning component for a second, and then the home page populated with client cards from the database.

close #3

This should be tested in a production environment, just to be sure.