Open LauraLangdon opened 1 year ago
I think we can add a drop down that includes log in for folks. https://posthog.com has something like this.
connect with github
or Login
based on the existence of the cookie. I think we can add a drop down that includes log in for folks. https://posthog.com has something like this.
Solution
- Check for the opensauced auth cookie, similar to how the AI extension does - https://github.com/open-sauced/ai/blob/beta/src/utils/checkAuthentication.ts
- Show
connect with github
orLogin
based on the existence of the cookie.
One way this could be achieved is by storing the providerToken
from the useSupabaseAuth()
hook in the insight repository to local storage or a cookie. This would make it accessible globally, allowing it to be fetched from the landing page.
Upon the user's arrival on the site, we would then check for the availability of the providerToken
. Here's the code to accomplish this:
// Check if providerToken is available in local storage if (localStorage.getItem('providerToken')) { // The providerToken is available console.log('Provider token is available in local storage.'); } else { // The providerToken is not available console.log('Provider token is not available in local storage.'); }
Depending on whether the providerToken
is available or not, the button text would change accordingly:
If the providerToken
is available, the button will display Sign In.
If the providerToken
is not available, the button will display Connect with GitHub.
for this we can go to simpler solution and use conditional rendering, where we redirect the person to a page in insights:
and we will change the copy to "Use The App",
I think this might have a simpler approach and less complex.
for this we can go to simpler solution and use conditional rendering, where we redirect the person to a page in insights:
- if they are logged in, then we will show feed,
- if not we will show sign up.
and we will change the copy to "Use The App",
I think this might have a simpler approach and less complex.
This is a nice idea but supabase authentication was not setup in this repo it was setup in the insights repo. So the only way to use this is if we setup supabase on this repo or pass the providerToken
from the insights: start
page in the insight repo to a localstorage hence allowing it to be accessible in the landing-page
repo
Yeah, I mean that we do not need to setup supabase here, we can just rely on the insight repo and do the logic there. Here we can just change the copy.
or we can just redirect them to: https://insights.opensauced.pizza/
or we can just redirect them to: https://insights.opensauced.pizza/
Currently on the landing page we have a similar logic
Yeah, I mean that we do not need to setup supabase here, we can just rely on the insight repo and do the logic there. Here we can just change the copy.
So should I open a feat request issue on the insight page to store the provider token
to the local storage?
Describe the bug
When an existing user navigates to https://opensauced.pizza, they can only log in by clicking "Connect with GitHub", which appears to restart the signup process.
Steps to reproduce
Browsers
Chrome, Firefox, Safari, Other (add additional context)
Additional context (Is this in dev or production?)
Arc browser
Code of Conduct
Contributing Docs