-
-
Save E01T/c71f44fce0c6c204ed6f3359245b852a to your computer and use it in GitHub Desktop.
Revisions
-
zenorocha revised this gist
Jul 18, 2016 . 4 changed files with 14 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,8 @@ var provider = new firebase.auth.FacebookAuthProvider(); provider.addScope('user_birthday'); firebase.auth().signInWithPopup(provider).then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); }); @@ -44,8 +44,8 @@ provider.addScope('user_birthday'); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,8 +30,8 @@ provider.addScope('repo'); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,8 @@ var provider = new firebase.auth.GoogleAuthProvider(); provider.addScope('https://www.googleapis.com/auth/plus.login'); firebase.auth().signInWithPopup(provider).then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); }); @@ -30,8 +30,8 @@ provider.addScope('https://www.googleapis.com/auth/plus.login'); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,8 @@ ```js var provider = new firebase.auth.TwitterAuthProvider(); firebase.auth().signInWithPopup(provider).then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); }); @@ -26,8 +26,8 @@ var provider = new firebase.auth.TwitterAuthProvider(); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(authData) { console.log(authData); }).catch(function(error) { console.log(error); }); -
zenorocha revised this gist
Jul 18, 2016 . 1 changed file with 28 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,20 @@ firebase.auth().signInWithPopup(provider).then(function(result) { }); ``` *Old API* ```js firebase.authWithOAuthPopup("facebook", function(error, authData) { if (error) { console.log(error); } else { console.log(authData); } }, { scope: 'user_birthday' }); ``` ## Sign In with Redirect *New API* @@ -37,6 +51,20 @@ firebase.auth().getRedirectResult().then(function(result) { }); ``` *Old API* ```js firebase.authWithOAuthRedirect("facebook", function(error) { if (error) { console.log(error); } else { // We'll never get here, as the page will redirect on success. } }, { scope: 'user_birthday' }); ``` ## Sign Out *New API* -
zenorocha revised this gist
Jul 15, 2016 . 4 changed files with 40 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,12 @@ # Facebook OAuth * [New docs](https://firebase.google.com/docs/auth/web/facebook-login) * [Old docs](https://www.firebase.com/docs/web/guide/login/facebook.html) ## Sign In with Popup *New API* ```js var provider = new firebase.auth.FacebookAuthProvider(); @@ -16,6 +21,8 @@ firebase.auth().signInWithPopup(provider).then(function(result) { ## Sign In with Redirect *New API* ```js var provider = new firebase.auth.FacebookAuthProvider(); @@ -32,6 +39,8 @@ firebase.auth().getRedirectResult().then(function(result) { ## Sign Out *New API* ```js firebase.auth().signOut().then(function() { // Sign-out successful. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,12 @@ # Github OAuth * [New docs](https://firebase.google.com/docs/auth/web/github-auth) * [Old docs](https://www.firebase.com/docs/web/guide/login/github.html) ## Sign In with Popup *New API* ```js var provider = new firebase.auth.GithubAuthProvider(); @@ -16,6 +21,8 @@ firebase.auth().signInWithPopup(provider).then(function(result) { ## Sign In with Redirect *New API* ```js var provider = new firebase.auth.GithubAuthProvider(); @@ -32,6 +39,8 @@ firebase.auth().getRedirectResult().then(function(result) { ## Sign Out *New API* ```js firebase.auth().signOut().then(function() { // Sign-out successful. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,12 @@ # Google OAuth * [New docs](https://firebase.google.com/docs/auth/web/google-signin) * [Old docs](https://www.firebase.com/docs/web/guide/login/google.html) ## Sign In with Popup *New API* ```js var provider = new firebase.auth.GoogleAuthProvider(); @@ -14,9 +19,10 @@ firebase.auth().signInWithPopup(provider).then(function(result) { }); ``` ## Sign In with Redirect *New API* ```js var provider = new firebase.auth.GoogleAuthProvider(); @@ -33,6 +39,8 @@ firebase.auth().getRedirectResult().then(function(result) { ## Sign Out *New API* ```js firebase.auth().signOut().then(function() { // Sign-out successful. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,12 @@ # Twitter OAuth * [New docs](https://firebase.google.com/docs/auth/web/twitter-login) * [Old docs](https://www.firebase.com/docs/web/guide/login/twitter.html) ## Sign In with Popup *New API* ```js var provider = new firebase.auth.TwitterAuthProvider(); @@ -14,6 +19,8 @@ firebase.auth().signInWithPopup(provider).then(function(result) { ## Sign In with Redirect *New API* ```js var provider = new firebase.auth.TwitterAuthProvider(); @@ -28,6 +35,8 @@ firebase.auth().getRedirectResult().then(function(result) { ## Sign Out *New API* ```js firebase.auth().signOut().then(function() { // Sign-out successful. -
zenorocha revised this gist
Jul 15, 2016 . 1 changed file with 28 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,9 +16,7 @@ firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(e *Old API* ```js firebase.createUser({ email : "[email protected]", password : "correcthorsebatterystaple" }, function(error, userData) { @@ -43,8 +41,7 @@ firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error *Old API* ```js firebase.authWithPassword({ email : "[email protected]", password : "correcthorsebatterystaple" }, function(error, authData) { @@ -58,6 +55,8 @@ ref.authWithPassword({ ## Sign out *New API* ```js firebase.auth().signOut().then(function() { // Sign-out successful. @@ -66,6 +65,29 @@ firebase.auth().signOut().then(function() { }); ``` *Old API* ```js firebase.unauth(); ``` ## Delete user *New API* > ? *Old API* ```js firebase.removeUser({ email : "[email protected]", password : "correcthorsebatterystaple" }, function(error) { if (error === null) { console.log("User removed successfully"); } else { console.log("Error removing user:", error); } }); ``` -
zenorocha revised this gist
Jul 15, 2016 . 1 changed file with 41 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +1,61 @@ # Basic Auth * [New docs](https://firebase.google.com/docs/auth/web/password-auth) * [Old docs](https://www.firebase.com/docs/web/guide/login/password.html) ## Create account *New API* ```js firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) { console.log(error); }); ``` *Old API* ```js var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com"); ref.createUser({ email : "[email protected]", password : "correcthorsebatterystaple" }, function(error, userData) { if (error) { console.log("Error creating user:", error); } else { console.log("Successfully created user account with uid:", userData.uid); } }); ``` ## Sign in *New API* ```js firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) { console.log(error); }); ``` *Old API* ```js var ref = new Firebase("https://<YOUR-FIREBASE-APP>.firebaseio.com"); ref.authWithPassword({ email : "[email protected]", password : "correcthorsebatterystaple" }, function(error, authData) { if (error) { console.log("Login Failed!", error); } else { console.log("Authenticated successfully with payload:", authData); } }); ``` ## Sign out ```js -
zenorocha revised this gist
Jul 15, 2016 . No changes.There are no files selected for viewing
-
zenorocha revised this gist
Jul 15, 2016 . 1 changed file with 41 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ # [Github OAuth](https://firebase.google.com/docs/auth/web/github-auth) ## Sign In with Popup ```js var provider = new firebase.auth.GithubAuthProvider(); provider.addScope('repo'); firebase.auth().signInWithPopup(provider).then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign In with Redirect ```js var provider = new firebase.auth.GithubAuthProvider(); provider.addScope('repo'); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign Out ```js firebase.auth().signOut().then(function() { // Sign-out successful. }, function(error) { console.log(error); }); ``` -
zenorocha revised this gist
Jul 15, 2016 . 1 changed file with 37 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ # [Twitter OAuth](https://firebase.google.com/docs/auth/web/twitter-login) ## Sign In with Popup ```js var provider = new firebase.auth.TwitterAuthProvider(); firebase.auth().signInWithPopup(provider).then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign In with Redirect ```js var provider = new firebase.auth.TwitterAuthProvider(); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign Out ```js firebase.auth().signOut().then(function() { // Sign-out successful. }, function(error) { console.log(error); }); ``` -
zenorocha revised this gist
Jul 15, 2016 . 1 changed file with 41 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ # [Facebook OAuth](https://firebase.google.com/docs/auth/web/facebook-login) ## Sign In with Popup ```js var provider = new firebase.auth.FacebookAuthProvider(); provider.addScope('user_birthday'); firebase.auth().signInWithPopup(provider).then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign In with Redirect ```js var provider = new firebase.auth.FacebookAuthProvider(); provider.addScope('user_birthday'); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign Out ```js firebase.auth().signOut().then(function() { // Sign-out successful. }, function(error) { console.log(error); }); ``` -
zenorocha revised this gist
Jul 15, 2016 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # [Basic Auth](https://firebase.google.com/docs/auth/web/password-auth) ## Create account This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # [Google OAuth](https://firebase.google.com/docs/auth/web/google-signin) ## Sign In with Popup -
zenorocha revised this gist
Jul 15, 2016 . 1 changed file with 42 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ # Google OAuth ## Sign In with Popup ```js var provider = new firebase.auth.GoogleAuthProvider(); provider.addScope('https://www.googleapis.com/auth/plus.login'); firebase.auth().signInWithPopup(provider).then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign In with Redirect ```js var provider = new firebase.auth.GoogleAuthProvider(); provider.addScope('https://www.googleapis.com/auth/plus.login'); firebase.auth().signInWithRedirect(provider); firebase.auth().getRedirectResult().then(function(result) { console.log(result); }).catch(function(error) { console.log(error); }); ``` ## Sign Out ```js firebase.auth().signOut().then(function() { // Sign-out successful. }, function(error) { console.log(error); }); ``` -
zenorocha created this gist
Jul 15, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ # Basic Auth ## Create account ```js firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) { console.log(error); }); ``` ## Sign in ```js firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) { console.log(error); }); ``` ## Sign out ```js firebase.auth().signOut().then(function() { // Sign-out successful. }, function(error) { console.log(error); }); ``` ## Delete user > ?