<commit_before># REST API Tokens With Passport.js and jwt-simple

- Demonstrates how to use auth token to Node.js with Passport.js and jwt-simple which is useful for building a token-based REST API.

Install
=======

    git clone <REPO>
    cd passport-jwt
    npm install
    git submodule init && git submodule update
    npm install -g mongodb
    mongod #start up mongodb (do this in another terminal tab)
    node app
    open http://localhost:1337/
    Go to Register. Create user.
    Go to Login and enter user's email/pass
    Click Test Token button and view user returned in console

Tests
=====

    make test #to run the test

Background
==========

This is an adaptation of Michael Herman's http://mherman.org/blog/2013/11/11/user-authentication-with-passport-dot-js/ tutorial where he shows an example of using passport-local with an expressjs stack to do local user/password style authentication. I had a need to do API token based authentication where you, essentially:<commit_msg>Fixed typos on the readme<commit_after># REST API Tokens With Passport.js and jwt-simple

- Demonstrates how to use auth token to Node.js with Passport.js and jwt-simple which is useful for building a token-based REST API.

Install
=======

    git clone <EMAIL>:roblevintennis/passport-api-tokens.git
    cd passport-api-tokens
    npm install
    git submodule init && git submodule update
    npm install -g mongodb
    mongod #start up mongodb (do this in another terminal tab)
    node app
    open http://localhost:1337/
    Go to Register. Create user.
    Go to Login and enter user's email/pass
    Click Test Token button and view user returned in console

Tests
=====

    make test #to run the test

Background
==========

This is an adaptation of Michael Herman's http://mherman.org/blog/2013/11/11/user-authentication-with-passport-dot-js/ tutorial where he shows an example of using passport-local with an expressjs stack to do local user/password style authentication. I had a need to do API token based authentication where you, essentially:
{'fraction_non_alphanumeric': 0.0748663101604278, 'fraction_numerical': 0.01166747690811862, 'mean_word_length': 3.513157894736842, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7498755', 'n_tokens_mistral': 602, 'n_tokens_neox': 553, 'n_words': 265}