added next-intl, composed next-auth and next-intl in middleware, fixed some bugs, completed details page, added google auth

This commit is contained in:
Alibek committed 2024-02-29 14:09:37 +06:00
1 parent 9cd7b2a67d
commit 6637ab4eae
172 files changed
+1772 -502

No files matched your search

+18 -1
View File
@@ -1,10 +1,27 @@
"use client";
import Image from "next/image";
import "./GoogleButton.scss";
import google from "./icons/google.svg";
import { useSearchParams } from "next/navigation";
import { signIn, useSession } from "next-auth/react";
const GoogleButton = () => {
const session = useSession();
const searchParams = useSearchParams();
const callbackUrl =
searchParams.get("callbackUrl") || "/profile/personal";
const googleLogin = async () => {
await signIn("google", { callbackUrl });
};
return (
<button className="google-btn">
<button
type="button"
className="google-btn"
onClick={googleLogin}
>
<Image src={google} alt="Google Icon" />
Войти через Google
</button>