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

Function doSignInWithGoogle

client/src/firebase/auth.js:20–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18};
19
20export const doSignInWithGoogle = async () => {
21 const provider = new GoogleAuthProvider();
22 const result = await signInWithPopup(auth, provider);
23 const user = result.user;
24
25 // Retrieve the user's ID token
26 const token = await user.getIdToken();
27
28 // Store the token in local storage (if needed)
29 localStorage.setItem("token", token);
30
31 // Now token is stored and can be used for further requests
32 return { user, token };
33};
34
35
36export const doSignOut = () => {

Callers 2

onGoogleSignInFunction · 0.90
onGoogleSignInFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected