-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Conversation
β Deploy Preview for oss-insights ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
β Deploy Preview for design-insights ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
const [host, setHost] = useState<string>(""); | ||
useEffect(() => { | ||
if (typeof window !== "undefined") { | ||
setHost(window.location.origin as string); | ||
} | ||
}, []); |
There was a problem hiding this comment.
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
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); | |
} | |
}, []); |
## [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))
π This PR is included in version 1.51.0-beta.1 π The release is available on GitHub release Your semantic-release bot π¦π |
## [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)
π This PR is included in version 1.51.0 π The release is available on GitHub release Your semantic-release bot π¦π |
## [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))
## [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)
What type of PR is this? (check all applicable)
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?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?