Skip to content

Commit

Permalink
Merge pull request #1 from blevinscm/blevinscm-patch-3
Browse files Browse the repository at this point in the history
Update email Sub/Pub section
  • Loading branch information
blevinscm committed May 26, 2015
2 parents ec9452c + e429656 commit 5c7a056
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .docs/angular-meteor/client/views/steps/tutorial.step_09.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,96 @@ Add this ng-repeat list to the end of parties-details.ng.html:
Run the app and see the list of all the users' emails that created a login and password and did not use a service to login.
Facebook, Google etc. users email is located in a sub-document called services.

The Document structure for the Facebook and Google login service looks like this:

/* 1 */
{
"_id" : "etKoiD8MxkQTjTQRY",
"createdAt" : ISODate("2015-05-25T17:42:16.850-07:00"),
"services" : {
"facebook" : {
"accessToken" : "CAAM10fSvIhABAKYNNnykDZAFZBOLwr9Qhj6kVq4MiMMO5VemAkJaiRvqSiYTkY3AqeBheYhzx7dumuruc07GRmPkmZC6S1ZAF0ZAZAXYzTjrA8cQlKkOZB0SwHBZAvZBMtQ4EaquvtUK0We7ZB4otbJBenrAF4uEZB9k5TfBrLGY8MdM7aP3Bvl4razrRZCIiPJZAuZB8ZCCZB6xeegzaiXVKMyUkRZC0mgHfkxRyZCVsZD",
"expiresAt" : 1437770457288.0000000000000000,
"id" : "10153317814289291",
"email" : "email@email.com",
"name" : "FirstName LastName",
"first_name" : "FirstName",
"last_name" : "LastName",
"link" : "https://www.facebook.com/app_scoped_user_id/foo"
"gender" : "male",
"locale" : "en_US"
},
"resume" : {
"loginTokens" : []
}
},
"profile" : {
"name" : "First Name LastName"
}
}

/* 2 */
{
"_id" : "337r4wwSRWe5B6CCw",
"createdAt" : ISODate("2015-05-25T22:53:32.172-07:00"),
"services" : {
"google" : {
"accessToken" : "ya29.fwHSzHvCYPh9Vz3UJcYEvMS9knV6LpTe-kQf3cx5567CL93EBVb-lXAaREU0vUQJvALTDesTiZDzTg",
"idToken" : "eyJhbGciOiJSUzI1NiIsImtpZCI6IjcxNThkODVjODU3ZjM2OGJmM2E0NDhiMjI3MjBhM2E1NWIwNzM0NDcifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTA3NDk3Mzc2Nzg5Mjg1ODg1MTIyIiwiYXpwIjoiNDE4NjcxMDMwNzI3LXNpcDh2NHBkMWJiN2F2YjdhdGtydTAwNm1jbmJnZW5rLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiZW1haWwiOiJibGV2aW5zY21AZ21haWwuY29tIiwiYXRfaGFzaCI6IjZMZTYwSE0zMkNxMkQybkRpMlQ2ZnciLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXVkIjoiNDE4NjcxMDMwNzI3LXNpcDh2NHBkMWJiN2F2YjdhdGtydTAwNm1jbmJnZW5rLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiaWF0IjoxNDMyNjIxMDkxLCJleHAiOjE0MzI2MjQ2OTF9.pYEDATkLdvC5DEcwOXrnZno2PHW_Y8y3XeIa7-pJemGi4QHAYKsnkRBP4cgVJ4kaTC9leSOFBrGjPNTbtfMTCp_jL_fcCkPbKyxHXwAK_k7fELmoScRZ7v7LV17GWUmdSsU-incnDYsCSBxvptcZkYQGJzqwsb74Yklh3SOfIho",
"expiresAt" : 1432624691685.0000000000000000,
"id" : "107497376789285885122",
"email" : "email@email.com",
"verified_email" : true,
"name" : "FirstName LastName",
"given_name" : "FirstName",
"family_name" : "LastName",
"picture" : "https://lh5.googleusercontent.com/-foo.jpeg
"locale" : "en",
"gender" : "male"
},
"resume" : {
"loginTokens" : [
{
"when" : ISODate("2015-05-25T23:18:11.788-07:00"),
"hashedToken" : "NaKS2Zeermw+bPlMLhaihsNu6jPaW5+ucFDF2BXT4WQ="
}
]
}
},
"profile" : {
"name" : "First Name LastName"
}
}
/* 3 */
{
"_id" : "8qJt6dRSNDHBuqpXu",
"createdAt" : ISODate("2015-05-26T00:29:05.109-07:00"),
"services" : {
"password" : {
"bcrypt" : "$2a$10$oSykELjSzcoFWXZTwI5.lOl4BsB1EfcR8RbEm/KsS3zA4x5vlwne6"
},
"resume" : {
"loginTokens" : [
{
"when" : ISODate("2015-05-26T00:29:05.112-07:00"),
"hashedToken" : "6edmW0Wby2xheFxyiUOqDYYFZmOtYHg7VmtXUxEceHg="
}
]
}
},
"emails" : [
{
"address" : "email@email.com",
"verified" : false
}
]
}
Compare the services login structure in Document /* 1 */ and document /* 2 */ with Document /* 3 */ which is a created login.
You can see why only created users will show up in our list of emails.
# Understanding Meteor's Publish-Subscribe
Expand Down

0 comments on commit 5c7a056

Please sign in to comment.