Complete the code to initialize GitHub sign-in provider.
const provider = new firebase.auth.[1]();The GitHubAuthProvider is used to enable GitHub sign-in in Firebase.
Complete the code to sign in with a popup using the GitHub provider.
firebase.auth().signInWith[1](provider).then(result => {
// handle result
});The method signInWithPopup opens a popup window for GitHub sign-in.
Fix the error in the code to get the GitHub access token from the sign-in result.
const credential = [1].credentialFromResult(result);
const token = credential.accessToken;The correct way to get the credential is using firebase.auth.GitHubAuthProvider.credentialFromResult(result).
Fill both blanks to request additional GitHub scopes and handle sign-in errors.
provider.[1]('repo'); firebase.auth().signInWithPopup(provider).catch(error => { const errorCode = error.[2]; // handle error });
Use addScope to request GitHub scopes. The error code is accessed via error.code.
Fill all three blanks to create a user object from the GitHub sign-in result.
const user = {
id: result.user.[1],
name: result.user.[2],
email: result.user.[3]
};The user object properties are uid for ID, displayName for name, and email for email address.