mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 11:33:14 +00:00
fix: Redirect to chat if token is defined (#675)
* fix: Redirect to chat if token is defined * cr * cr
This commit is contained in:
parent
162d66016e
commit
229b65bff4
1 changed files with 9 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { GitHubSVG } from "@/components/icons/github";
|
||||
|
|
@ -42,6 +43,13 @@ function AuthStatusContent() {
|
|||
fetchGitHubToken,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (githubToken) {
|
||||
console.log("redirecting to chat");
|
||||
router.push("/chat");
|
||||
}
|
||||
}, [githubToken]);
|
||||
|
||||
const checkAuthStatus = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/auth/status");
|
||||
|
|
@ -172,6 +180,7 @@ function AuthStatusContent() {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue