MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / signIn

Function signIn

run/idp-sql/static/firebase.js:37–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35
36// [START cloudrun_end_user_firebase_sign_in]
37function signIn() {
38 const provider = new firebase.auth.GoogleAuthProvider();
39 provider.addScope('https://www.googleapis.com/auth/userinfo.email');
40 firebase
41 .auth()
42 .signInWithPopup(provider)
43 .then(result => {
44 // Returns the signed in user along with the provider's credential
45 console.log(`${result.user.displayName} logged in.`);
46 window.alert(`Welcome ${result.user.displayName}!`);
47 })
48 .catch(err => {
49 console.log(`Error during sign in: ${err.message}`);
50 window.alert('Sign in failed. Retry or check your browser logs.');
51 });
52}
53// [END cloudrun_end_user_firebase_sign_in]
54
55function signOut() {

Callers 1

toggleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected