Git Product home page Git Product logo

requirepin's Introduction

REQUIRE PIN

Latest Version on Packagist Quality Score Code Quality Vulnerability Github Workflow Status Total Downloads Licence

A simple Laravel package that provides a middleware which will require users to confirm routes utilizing their pin for authentication.

REQUIREMENTS

  • PHP 8.0+
  • Laravel 9+

STEPS TO INSTALL

composer require ikechukwukalu/requirepin
  • php artisan vendor:publish --tag=rp-migrations
  • php artisan migrate
  • Set REDIS_CLIENT=predis and QUEUE_CONNECTION=redis within your .env file.
  • php artisan queue:work

ROUTES

Api routes

  • POST api/change/pin
  • POST api/pin/required/{uuid}

Web routes

  • POST change/pin
  • POST pin/required/{uuid}
  • GET change/pin
  • GET pin/required/{uuid?}

NOTE

  • To receive json response add 'Accept': 'application/json' to your headers.

HOW IT WORKS

  • First, it's like eating candy.
  • The require.pin middlware should be added to a route or route group.
  • This middleware will arrest all incoming requests.
  • A temporary URL (pin/required/{uuid}) is generated for a user to authenticate with the specified input config(requirepin.input) using their pin.
  • It either returns a JSON response with the generated URL or it redirects to a page where a user is required to authenticate the request by entering their pin into a form that will send a POST request to the generated URL when submitted.

Reserved keys for payload

  • _uuid
  • _pin
  • expires
  • signature
  • return_payload
  • pin_validation

PUBLISH CONFIG

  • php artisan vendor:publish --tag=rp-config

PUBLISH LANG

  • php artisan vendor:publish --tag=rp-lang

PUBLISH VIEWS

  • php artisan vendor:publish --tag=rp-views

LICENSE

The RP package is an open-sourced software licensed under the MIT license.

requirepin's People

Contributors

monitecture 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.