🚧 (wip) get oauth url from backend
this function is under development and still need fixing
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user