Skip to content
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

Bug: no "Log in" button #135

Open
2 tasks done
LauraLangdon opened this issue Jul 11, 2023 · 8 comments
Open
2 tasks done

Bug: no "Log in" button #135

LauraLangdon opened this issue Jul 11, 2023 · 8 comments
Labels
🐛 bug Something isn't working

Comments

@LauraLangdon
Copy link

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

  1. Go to https://opensauced.pizza
  2. In the upper right corner of the page, there's a "Connect with GitHub" button, but no "Log in" button

Browsers

Chrome, Firefox, Safari, Other (add additional context)

Additional context (Is this in dev or production?)

Arc browser

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributing Docs

  • I agree to follow this project's Contribution Docs
@LauraLangdon LauraLangdon added 🐛 bug Something isn't working 👀 needs triage labels Jul 11, 2023
@bdougie
Copy link
Member

bdougie commented Aug 2, 2023

I think we can add a drop down that includes log in for folks. https://posthog.com has something like this.

Screen Shot 2023-08-02 at 7 19 04 AM

Solution

  1. 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
  2. Show connect with github or Login based on the existence of the cookie.

@dev-phantom
Copy link
Contributor

I think we can add a drop down that includes log in for folks. https://posthog.com has something like this.

Screen Shot 2023-08-02 at 7 19 04 AM

Solution

  1. 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
  2. Show connect with github or Login 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.

@a0m0rajab
Copy link

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.

@dev-phantom
Copy link
Contributor

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

@a0m0rajab
Copy link

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.

@a0m0rajab
Copy link

or we can just redirect them to: https://insights.opensauced.pizza/

@dev-phantom
Copy link
Contributor

or we can just redirect them to: https://insights.opensauced.pizza/

Currently on the landing page we have a similar logic

@dev-phantom
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants