MCPcopy Create free account
hub / github.com/Bitbox-Connect/Bitbox / onGoogleSignIn

Function onGoogleSignIn

client/src/component/Login.jsx:101–117  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

99
100 // Handle Google Sign-In
101 const onGoogleSignIn = async (e) => {
102 e.preventDefault();
103 try {
104 const { token } = await doSignInWithGoogle();
105 if (token) {
106 localStorage.setItem("token", token);
107 setloggedin(true);
108 toast.success("Google sign-in successful!");
109 } else {
110 toast.error("Google sign-in failed.");
111 }
112 } catch (error) {
113 console.error("Google sign-in error:", error);
114 toast.error("Google sign-in failed. Please try again.");
115 setloggedin(false);
116 }
117 };
118
119 return (
120 <div className="min-h-screen flex items-center justify-center mt-14" data-aos="zoom-in" data-aos-duration="1800">

Callers 1

LoginFunction · 0.70

Calls 1

doSignInWithGoogleFunction · 0.90

Tested by

no test coverage detected