This commit is contained in:
parent
dc838f22e0
commit
cd69ad2c68
|
|
@ -8,30 +8,30 @@ import * as React from "react";
|
||||||
import { OAuthButton } from "../oauth-button";
|
import { OAuthButton } from "../oauth-button";
|
||||||
|
|
||||||
export function OAuthSignIn() {
|
export function OAuthSignIn() {
|
||||||
// const [isLoading, setIsLoading] = React.useState<OAuthStrategy | null>(null);
|
const [isLoading, setIsLoading] = React.useState<OAuthStrategy | null>(null);
|
||||||
// const { signIn, isLoaded: signInLoaded } = useSignIn();
|
const { signIn, isLoaded: signInLoaded } = useSignIn();
|
||||||
|
|
||||||
// const oauthSignIn = async (provider: OAuthStrategy) => {
|
const oauthSignIn = async (provider: OAuthStrategy) => {
|
||||||
// if (!signInLoaded) {
|
if (!signInLoaded) {
|
||||||
// return null;
|
return null;
|
||||||
// }
|
}
|
||||||
// try {
|
try {
|
||||||
// setIsLoading(provider);
|
setIsLoading(provider);
|
||||||
// await signIn.authenticateWithRedirect({
|
await signIn.authenticateWithRedirect({
|
||||||
// strategy: provider,
|
strategy: provider,
|
||||||
// redirectUrl: "/auth/sso-callback",
|
redirectUrl: "/auth/sso-callback",
|
||||||
// redirectUrlComplete: "/app/apis",
|
redirectUrlComplete: "/app/apis",
|
||||||
// });
|
});
|
||||||
// } catch (err) {
|
} catch (err) {
|
||||||
// console.error(err);
|
console.error(err);
|
||||||
// setIsLoading(null);
|
setIsLoading(null);
|
||||||
// toast.error((err as Error).message);
|
toast.error((err as Error).message);
|
||||||
// }
|
}
|
||||||
// };
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
{/* <OAuthButton onClick={() => oauthSignIn("oauth_github")}>
|
<OAuthButton onClick={() => oauthSignIn("oauth_github")}>
|
||||||
{isLoading === "oauth_github" ? (
|
{isLoading === "oauth_github" ? (
|
||||||
<Loading className="w-6 h-6" />
|
<Loading className="w-6 h-6" />
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -46,7 +46,7 @@ export function OAuthSignIn() {
|
||||||
<Google className="w-6 h-6" />
|
<Google className="w-6 h-6" />
|
||||||
)}
|
)}
|
||||||
Google
|
Google
|
||||||
</OAuthButton> */}
|
</OAuthButton>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue