Git Product home page Git Product logo

react-jwt-auth's Introduction

React JWT Auth

Token based authentication for react.

Build Status Coverage Status Code Climate Codacy Badge npm
dependencies Status devDependencies Status peerDependencies Status

Work in progress. Contributions are welcomed!

Inspiration

Satellizer, for its simplicity, clear code and maturity was initial source of inspiration. As there is no need to reinvent the wheel, some of Satellizer code has been reused where possible and adopted to React.

Setup

Before you start using component you should configure it, eg:

ReactDOM.render(
	<Auth baseUrl="http://localhost:8080/api/">
		<YourAwesomeComponents />
	</Auth>,
	document.getElementById('app')
);

More in docs, configuration section.

Social buttons

Here is simplest example of social buttons in use inside of your component reder() method.

render () {
	return (
		<div className="form-group">
			<Facebook clientId="310178806023492" />
			<Google clientId="389760969675-u3h2dgm1v3lqd22u8aloimkgd10i0rvf.apps.googleusercontent.com"	/>
		</div>
	)
}

Testing

You can run all tests with:

npm test

Test coverage

We run test coverage with nyc and [here][nyc-why] is why. [nyc-why]: http://stackoverflow.com/a/33725069/6096446)

You can run test coverage task locally with:

npm run test:coverage

It will:

  • run all tests
  • generate coverage data
  • create coverage report files in ./coverage folder
  • check minimum coverage requirements set to 95%

Additionally we use coveralls.io for coverage badge generation. Coverage Status

react-jwt-auth's People

Contributors

fullstackforger avatar

Watchers

Nimer Farahty avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.