Skip to content

ChipCastleDotCom/meteor-accounts-email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Introduction

A Meteor package for extracting an email address from an Accounts object.

Installation

meteor add chipcastledotcom:accounts-email

Password service support

Here's an example object using the password service, such as one that would be created when using the accounts-password package:

var passwordAccount = {
  "_id" : "RpX3aJAKkvwaTegWY",
  "createdAt" : "2015-01-04T03:58:34.740Z",
  "emails" : [
    {
      "address" : "[email protected]",
      "verified" : false
    }
  ],
  "profile" : {
    "name" : "CCDC Support",
    "admin" : true
  },
  "services" : {
    "password" : {
      "bcrypt" : "$2a$10$1UgOmM7LCYgjLCfG4yQi0.Brm9Agl2AJYrEUJ3UaRZgHtTC1xLcia"
    },
    "resume" : {
      "loginTokens" : [ ]
    }
  }
};

The email address could be determined by using this package as follows:

var email = AccountsEmail.extract(passwordAccount);

The email variable above in this case would be set to [email protected].

Oauth service support

Here's an example object using the github service, such as one that would be created when using the accounts-gitub package:

var githubAccount = {
  "_id" : "Wasb5Nij7EjdS6ndC",
  "createdAt" : "2015-09-11T22:19:15.241Z",
  "services" : {
    "github" : {
      "id" : 31725,
      "accessToken" : "7b949b4ab94956c7c289b419a22b2b302b99bcbe",
      "email" : "[email protected]",
      "username" : "chip"
    },
    "resume" : {
      "loginTokens" : [
        {
          "when" : "2015-09-11T22:19:17.823Z",
          "hashedToken" : "6OMXf5tL2dnTJx5CVItXMcoWzRZ8qr24jgDlTJwib+w="
        }
      ]
    }
  }
};

The email address could be determined by using this package as follows:

var email = AccountsEmail.extract(githubAccount);

The email variable above in this case would be set to [email protected].

The following OAuth service libraries are supported:

  • accounts-facebook
  • accounts-google
  • accounts-twitter
  • accounts-github

SPECIAL THANKS TO

The Meteor Chef for the code inspiration.

Donating

Support via Gratipay

License

Software provided under the MIT License.

Endorse my work on Coderwall

endorse

Contributing

Please fork this repo and write tests.

Testing

From within this repository's directory:

meteor test-packages ./

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published