Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { firebaseAuth, firebaseDb } from '../../lib/firebase'
constructor(props) {
super(props)
this.provider = new firebaseAuth.TwitterAuthProvider()
}
handleTwitterLogin(event) {
firebaseAuth().signInWithPopup(this.provider)
.then((result) => {
firebaseDb.ref('credentials/' + result.user.uid)
.set({
userId: result.user.uid,
twitterAccessToken: result.credential.accessToken,
twitterSecret: result.credential.secret,
twitterIdStr: result.additionalUserInfo.profile.id_str
})
})
.catch((error) => {
console.error("Firebase sign-in error:", error)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.