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

feat: implement dynamic redirect on auth #1240

Merged
merged 3 commits into from
Jun 6, 2023
Merged

Conversation

OgDev-01
Copy link
Contributor

@OgDev-01 OgDev-01 commented Jun 2, 2023

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Description

Add redirect option to GitHub OAuth sign-in and fix useSupabaseAuth hook

This PR adds a redirect option to the GitHub OAuth sign-in button in the AuthSection component, allowing users to be redirected back to the current page after signing in. Additionally, it fixes a bug in the useSupabaseAuth hook where the options object was not being properly destructured.

Generated using OpenSauced.

Related Tickets & Documents

Closes #1075

Mobile & Desktop Screenshots/Recordings

Screen.Recording.2023-06-02.at.08.37.13.mov

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

@netlify
Copy link

netlify bot commented Jun 2, 2023

βœ… Deploy Preview for oss-insights ready!

Name Link
πŸ”¨ Latest commit ad79b47
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/64799d5ec8b72f0007078f29
😎 Deploy Preview https://deploy-preview-1240--oss-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jun 2, 2023

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit ad79b47
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/64799d5e0009bc00089afc9f
😎 Deploy Preview https://deploy-preview-1240--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@OgDev-01 OgDev-01 added the needs review PRs that need review from core engineering team label Jun 2, 2023
Comment on lines +38 to +43
const [host, setHost] = useState<string>("");
useEffect(() => {
if (typeof window !== "undefined") {
setHost(window.location.origin as string);
}
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've done this in a few places now. This should be a reusable hook

Suggested change
const [host, setHost] = useState<string>("");
useEffect(() => {
if (typeof window !== "undefined") {
setHost(window.location.origin as string);
}
}, []);
const [host, setHost] = useState<string>("");
useEffect(() => {
if (typeof window !== "undefined") {
setHost(window.location.origin as string);
}
}, []);

@brandonroberts brandonroberts merged commit 548cc4d into beta Jun 6, 2023
11 checks passed
@brandonroberts brandonroberts deleted the 1075-dynamic-redirect branch June 6, 2023 14:23
github-actions bot pushed a commit that referenced this pull request Jun 6, 2023
## [1.51.0-beta.1](v1.50.1-beta.3...v1.51.0-beta.1) (2023-06-06)

### πŸ• Features

* implement dynamic redirect on auth ([#1240](#1240)) ([548cc4d](548cc4d))
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

πŸŽ‰ This PR is included in version 1.51.0-beta.1 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

@takanome-dev takanome-dev mentioned this pull request Jun 6, 2023
19 tasks
github-actions bot pushed a commit that referenced this pull request Jun 6, 2023
## [1.51.0](v1.50.0...v1.51.0) (2023-06-06)

### πŸ• Features

* add share tracking ([#1250](#1250)) ([5b7d331](5b7d331))
* implement dynamic redirect on auth ([#1240](#1240)) ([548cc4d](548cc4d))

### πŸ› Bug Fixes

* Footer Location on Smaller Screens ([#1242](#1242)) ([8b2356a](8b2356a))
* reports select issue ([#1239](#1239)) ([a48bc87](a48bc87))
* update contributors hook to use contributor API endpoint ([#1238](#1238)) ([eff01c0](eff01c0))
* update hook for Posthog ([cd4f32c](cd4f32c))
* update medium activity threshold for repositories ([#1251](#1251)) ([4730533](4730533)), closes [#1224](#1224)
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

πŸŽ‰ This PR is included in version 1.51.0 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.51.0-beta.1](open-sauced/app@v1.50.1-beta.3...v1.51.0-beta.1) (2023-06-06)

### πŸ• Features

* implement dynamic redirect on auth ([#1240](open-sauced/app#1240)) ([548cc4d](open-sauced/app@548cc4d))
ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.51.0](open-sauced/app@v1.50.0...v1.51.0) (2023-06-06)

### πŸ• Features

* add share tracking ([#1250](open-sauced/app#1250)) ([5b7d331](open-sauced/app@5b7d331))
* implement dynamic redirect on auth ([#1240](open-sauced/app#1240)) ([548cc4d](open-sauced/app@548cc4d))

### πŸ› Bug Fixes

* Footer Location on Smaller Screens ([#1242](open-sauced/app#1242)) ([8b2356a](open-sauced/app@8b2356a))
* reports select issue ([#1239](open-sauced/app#1239)) ([a48bc87](open-sauced/app@a48bc87))
* update contributors hook to use contributor API endpoint ([#1238](open-sauced/app#1238)) ([eff01c0](open-sauced/app@eff01c0))
* update hook for Posthog ([cd4f32c](open-sauced/app@cd4f32c))
* update medium activity threshold for repositories ([#1251](open-sauced/app#1251)) ([4730533](open-sauced/app@4730533)), closes [#1224](open-sauced/app#1224)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review PRs that need review from core engineering team released on @beta released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: redirected user's back to where they were before authenticating
2 participants