Skip to content

Commit

Permalink
Merge pull request #148 from OpenWebhook/auto-redirect-for-github
Browse files Browse the repository at this point in the history
feature(Auth): autoredirect on github auth for github.webhook.store
  • Loading branch information
Samox authored Oct 20, 2022
2 parents 607cea1 + d66e478 commit b0eeceb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/User/LoginOrDisplayUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ export const LoginOrDisplayUser = () => {
window.location.href = "/";
}, []);

useEffect(() => {
const autoredirectOnGithubAuth =
window.location.hostname === "github.webhook.store";
if (autoredirectOnGithubAuth) {
window.location.href = `${
import.meta.env.VITE_AUTH_TENANT_URL
}/oauth/login`;
}
}, []);

if (identityToken) {
const decodedToken =
decodeJWT<{ name: string; picture: string }, any>(identityToken);
Expand Down

0 comments on commit b0eeceb

Please sign in to comment.