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

Feature: Force login when checking the box #1132

Closed
1 of 2 tasks
bdougie opened this issue May 1, 2023 · 16 comments · Fixed by #1184
Closed
1 of 2 tasks

Feature: Force login when checking the box #1132

bdougie opened this issue May 1, 2023 · 16 comments · Fixed by #1184

Comments

@bdougie
Copy link
Member

bdougie commented May 1, 2023

Type of feature

🍕 Feature

Current behavior

Screen Shot 2023-05-01 at 9 06 47 AM

Today when a user is logged out, we do not allow them to check a box. Instead we make this an allowed action. When the user clicks "Create Insight," that should logged them in and present them with an insight page with the items selected in the cart.

Suggested solution

Screen Shot 2023-05-01 at 9 08 44 AM

Additional context

No response

Code of Conduct

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

Contributing Docs

  • I agree to follow this project's Contribution Docs
@a0m0rajab
Copy link
Contributor

This is challenging, but I would like to work on it. If it's not urgent, I will work on the weekend.
.take

@github-actions
Copy link

github-actions bot commented May 1, 2023

The auto-take issues workflow is not enabled here, we can only assign issues to @open-sauced/triage, @open-sauced/committers, @open-sauced/maintainers in this repo for now. We suggest folks not on the team open issues and take a look at the Bugs or Papercuts. If you would like to find good first issues, please check out the companion project to this, open-sauced/hot.

@a0m0rajab
Copy link
Contributor

As first insights:

The login can be done with the Supabase auth: https://github.com/open-sauced/insights/blob/beta/pages/hub/insights/%5BinsightId%5D/accept.tsx#L16

The selected repo is being handled in the repo table:
https://github.com/open-sauced/insights/blob/beta/components/organisms/RepositoriesTable/repositories-table.tsx

The check box is disabled in the table row:
https://github.com/open-sauced/insights/blob/beta/components/molecules/RepoRow/repo-row.tsx#L211

What's the next step:

  • we should enable the checkbox in the table row.
  • Add the login logic to the add to insight page button based on the connect one (from the first link)

@a0m0rajab
Copy link
Contributor

I could not open the list of the repos
image

I got this issue:
image

is it related to the .env file or something else? @takanome-dev

@takanome-dev
Copy link
Contributor

I'm not really sure, I'm getting the same error right now.

The response status is 524

What Is the 524 Gateway Timeout Error? The 524 gateway Timeout Error is a Cloudflare-specific HTTP status code that indicates that the connection to the server has been closed due to a timeout.

Maybe it's due to slow network 🤔

issue-fetch

cc @0-vortex @OgDev-01 any ideas?

@OgDev-01
Copy link
Contributor

OgDev-01 commented May 8, 2023

@takanome-dev and @a0m0rajab
Auth in beta is currently down and will be fixed soonest. That is the reason you get the error 524

@a0m0rajab
Copy link
Contributor

Thank you for the information and help.

@bdougie bdougie added this to the Papercuts milestone May 8, 2023
@a0m0rajab
Copy link
Contributor

@OgDev-01 @0-vortex just thought, if the fix could take time, is there any dummy data been used before for such a situation?

@bdougie
Copy link
Member Author

bdougie commented May 16, 2023

@a0m0rajab beta is fixed.

a0m0rajab added a commit to a0m0rajab/insights that referenced this issue May 16, 2023
@a0m0rajab
Copy link
Contributor

Opened a PR. There are two things I noticed here I am not sure if I should do in this PR or create a new one:

  1. The redirect option in the sign-in logic is not redirecting to the same page, it's going to the main page: https://github.com/open-sauced/insights/blob/beta/lib/hooks/useSupabaseAuth.ts#L43
  2. The logic we have right now does not keep track of the selected repos. It's just forcing sign-in, should we keep track of the repos and use that when we force the user to sign in?

From my perspective, I think both of them need to be done, but wanted to get your input.

@bdougie
Copy link
Member Author

bdougie commented May 16, 2023

Both are needed in this PR. I don't know @brandonroberts has a better suggestion but I think we could use the context library to save that while being redirected.

@brandonroberts
Copy link
Contributor

  1. The redirect URL after login is something we still need to handle. I think we solved the issue with the config, but need to verify.
  2. If we force login as soon as they try to check one of the boxes, tracking the repos isn't going to help much there. If we let them check the repositories, and force login when they click to create a page, then we could store them in the redirect URL for when they come back after login. This is what we do currently if they are already logged in

@takanome-dev
Copy link
Contributor

I think there is an open issue about the redirect after login here -> #1075

@a0m0rajab
Copy link
Contributor

@takanome-dev Thank you for that! it helped me!

I added redirect in the last commit that I have but there is only one issue, when I add the query data to the redirect it's just not being sent to the redirect.

github-actions bot pushed a commit that referenced this issue Jun 26, 2023
## [1.54.0-beta.4](v1.54.0-beta.3...v1.54.0-beta.4) (2023-06-26)

### 🍕 Features

* allow login flow after selecting repositories to add to insight page (close [#1132](#1132)) ([#1184](#1184)) ([21aaa0b](21aaa0b))
@github-actions
Copy link

🎉 This issue has been resolved in version 1.54.0-beta.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Jun 28, 2023
## [1.54.0](v1.53.0...v1.54.0) (2023-06-28)

### 🐛 Bug Fixes

* fix yellow color for `<Pill />` component ([#1299](#1299)) ([2f2d9f5](2f2d9f5))

### 🍕 Features

*  hide highlights tab components on profiles without highlights ([#1304](#1304)) ([976739f](976739f))
* add `BillBoard` component to design system ([#1306](#1306)) ([1181cfd](1181cfd))
* add `FeaturedHighlightPanel` component to design system ([#1307](#1307)) ([452213c](452213c))
* add `UserCard` component to storybook design system ([#1295](#1295)) ([6867011](6867011))
* add highlight prompt to design system ([#1297](#1297)) ([4a85e74](4a85e74))
* add top users panel component to design system ([#1300](#1300)) ([9c05fec](9c05fec))
* add URL for collaboration requests ([#1305](#1305)) ([b3f8ea5](b3f8ea5))
* allow login flow after selecting repositories to add to insight page (close [#1132](#1132)) ([#1184](#1184)) ([21aaa0b](21aaa0b))
* implemented/added scroll-area component to design-system  ([#1283](#1283)) ([b7280ab](b7280ab))
@github-actions
Copy link

🎉 This issue has been resolved in version 1.54.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this issue Aug 17, 2023
## [1.54.0-beta.4](open-sauced/app@v1.54.0-beta.3...v1.54.0-beta.4) (2023-06-26)

### 🍕 Features

* allow login flow after selecting repositories to add to insight page (close [#1132](open-sauced/app#1132)) ([#1184](open-sauced/app#1184)) ([21aaa0b](open-sauced/app@21aaa0b))
ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this issue Aug 17, 2023
## [1.54.0](open-sauced/app@v1.53.0...v1.54.0) (2023-06-28)

### 🐛 Bug Fixes

* fix yellow color for `<Pill />` component ([#1299](open-sauced/app#1299)) ([2f2d9f5](open-sauced/app@2f2d9f5))

### 🍕 Features

*  hide highlights tab components on profiles without highlights ([#1304](open-sauced/app#1304)) ([976739f](open-sauced/app@976739f))
* add `BillBoard` component to design system ([#1306](open-sauced/app#1306)) ([1181cfd](open-sauced/app@1181cfd))
* add `FeaturedHighlightPanel` component to design system ([#1307](open-sauced/app#1307)) ([452213c](open-sauced/app@452213c))
* add `UserCard` component to storybook design system ([#1295](open-sauced/app#1295)) ([6867011](open-sauced/app@6867011))
* add highlight prompt to design system ([#1297](open-sauced/app#1297)) ([4a85e74](open-sauced/app@4a85e74))
* add top users panel component to design system ([#1300](open-sauced/app#1300)) ([9c05fec](open-sauced/app@9c05fec))
* add URL for collaboration requests ([#1305](open-sauced/app#1305)) ([b3f8ea5](open-sauced/app@b3f8ea5))
* allow login flow after selecting repositories to add to insight page (close [#1132](open-sauced/app#1132)) ([#1184](open-sauced/app#1184)) ([21aaa0b](open-sauced/app@21aaa0b))
* implemented/added scroll-area component to design-system  ([#1283](open-sauced/app#1283)) ([b7280ab](open-sauced/app@b7280ab))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants