Coder Social home page Coder Social logo

therealjmj / react-app-protect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bay0/react-app-protect

0.0 1.0 0.0 5.64 MB

Password protect a react app.

Home Page: https://bay0.github.io/react-app-protect/

HTML 1.77% JavaScript 14.27% CSS 83.96%

react-app-protect's Introduction

react-app-protect

Password protect a react app.

Simple password field, not a replacment for basic auth.

Not secure at all.

NPM JavaScript Style Guide

Demo

password: test

Install

npm install --save react-app-protect
yarn add react-app-protect

Using FingerprintJS to encrypt the password via AES. Storing the cipher in the localStorage. Checking if the stored cipher is valid against the sha512 hash.

Props

Name Type Default Description
sha512 String SHA 512 Hash app
blur Boolean false Blur the content
boxTitle String This page is password protected. Title of the login box
inputPlaceholder String Password Placeholder for the input field
buttonLabel String Submit Label used for the button
styles Object Styles

Usage

import React, { Component } from 'react'

import Protect from 'react-app-protect'
import 'react-app-protect/dist/index.css'

class App extends Component {
  render() {
    return (
      <Protect sha512='EE26B0DD4AF7E749AA1A8EE3C10AE9923F618980772E473F8819A5D4940E0DB27AC185F8A0E1D5F84F88BC887FD67B143732C304CC5FA9AD8E6F57F50028A8FF'>
        <div>Content</div>
      </Protect>
    )
  }
}

License

MIT © bay0

react-app-protect's People

Contributors

bay00 avatar bay0 avatar therealjmj avatar pickertjoe avatar

Watchers

James Cloos 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.