signIn('google', {
- callbackUrl: '/'
+ callbackUrl: '/profiles'
})} className="flex flex-row items-center gap-4 mt-8 justify-center">
signIn('github', {
- callbackUrl: '/'
+ callbackUrl: '/profiles'
})} className="w-10 h-10 bg-white rounded-full flex items-center justify-center cursor-pointer hover:opacity-80 transition">
diff --git a/pages/index.tsx b/pages/index.tsx
index 6142f8f..1d55463 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -1,3 +1,4 @@
+import Navbar from "@/components/Navbar"
import useCurrentUser from "@/hooks/useCurrentUser"
import { NextPageContext } from "next"
import { signOut,getSession } from "next-auth/react"
@@ -19,11 +20,9 @@ export async function getServerSideProps(context: NextPageContext){
export default function Home() {
- const { data: user } = useCurrentUser();
return (
<>
-
Netflix Clone
-
+
>
)
}
diff --git a/pages/profiles.tsx b/pages/profiles.tsx
index e73f496..600f031 100644
--- a/pages/profiles.tsx
+++ b/pages/profiles.tsx
@@ -1,5 +1,7 @@
+import useCurrentUser from "@/hooks/useCurrentUser";
import { NextPageContext } from "next"
import { getSession } from "next-auth/react"
+import { useRouter } from "next/router";
export async function getServerSideProps(context: NextPageContext){
const session = await getSession(context);
@@ -18,8 +20,27 @@ export async function getServerSideProps(context: NextPageContext){
function Profiles() {
+ const router = useRouter();
+ const { data:user } = useCurrentUser();
return (
-
Profili
+
+
+
Chi sta guardando?
+
+
router.push('/')}>
+
+
+
+
+
+ {user?.name}
+
+
+
+
+
+ {/* https://api.dicebear.com/6.x/fun-emoji/svg?seed= */}
+
)
}