🚧 (wip) get oauth url from backend

this function is under development and still need fixing
This commit is contained in:
2025-08-22 22:43:34 +07:00
parent a6b8ba9c3d
commit ab5bbd3491
3 changed files with 29 additions and 2 deletions

View File

@ -1,8 +1,24 @@
"use client";
import { Button } from "@heroui/react";
import { Icon } from "@iconify/react";
import React from "react";
import React, { useEffect, useState } from "react";
import getGoogleAuthUrl from "../lib/getGoogleAuthUrl";
const OAuthProviders = () => {
const [UrlOauth, setUrlOauth] = useState("please wait...");
useEffect(() => {
(async () => {
try {
const res = await getGoogleAuthUrl(); // panggil server function
setUrlOauth(JSON.stringify(res));
} catch (err) {
console.error(err);
}
})();
}, []);
// set to true if there are other providers coming soon
const comingSoonProviders: boolean = true;
@ -33,6 +49,8 @@ const OAuthProviders = () => {
);
})}
<h1>{UrlOauth}</h1>
{comingSoonProviders && (
<Button className="w-full" variant="ghost" isDisabled>
Other login options will come soon