Skip to content

Commit

Permalink
Update connected.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
zach-herridge authored Jan 26, 2024
1 parent 50db80e commit c34fd7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/ggg/connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { usePoeStackAuth } from "@contexts/user-context";
export default function Connected() {
const router = useRouter();

const { code } = router.query;
const { code, state } = router.query;
const { connect, jwt } = usePoeStackAuth();

useEffect(() => {
const codeRaw = code.toString()
if(codeRaw.includes("dawncode") {
const state = state.toString()
if(state.includes("dawncode")) {
if(!!jwt) {
router.push(`https://bulk.poestack.com/auth?jwt=${jwt}`);
}
Expand All @@ -21,10 +21,11 @@ export default function Connected() {
useEffect(() => {
if (code?.length) {
const codeRaw = code.toString()
const state = state.toString()
connect(codeRaw);

if (
!codeRaw.includes("dawncode") &&
!state.includes("dawncode") &&
typeof window !== "undefined" &&
localStorage.getItem("variable-redirect")
) {
Expand Down

0 comments on commit c34fd7c

Please sign in to comment.