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

fix: redirect after oauth #14

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion frontend/app/auth/google/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useRouter, useSearchParams } from "next/navigation";
import { CheckCircleIcon } from "lucide-react";

import { authGoogleAuthGoogleGet } from "@/client";
import Link from "@/components/navigation/link";
import { Box } from "@/components/ui/box";
import {
Card,
Expand Down Expand Up @@ -32,6 +33,7 @@ export default function GoogleOAuth() {
}
await authGoogleAuthGoogleGet({ query: { code } });
setIsLoading(false);
router.push("/");
})();
}
}, [code, router]);
Expand All @@ -55,8 +57,13 @@ export default function GoogleOAuth() {
<span className="max-w-sm">
{isLoading
? "Hang tight! We're logging you in. This shouldn't take too long."
: "All done! You should be redirected soon."}
: "All done! You should be redirected :qsoon."}
seelengxd marked this conversation as resolved.
Show resolved Hide resolved
</span>
{!isLoading && (
<Link className="p-2" href={"/"} size={"sm"}>
Redirect now
</Link>
)}
</CardDescription>
</CardContent>
</Card>
Expand Down
Loading