Coder Social home page Coder Social logo

joffreyberrier / strapi-plugin-passwordless Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kucherenko/strapi-plugin-passwordless

0.0 0.0 0.0 470 KB

A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email.

License: MIT License

JavaScript 100.00%

strapi-plugin-passwordless's Introduction

stand with Ukraine

Strapi PasswordLess Plugin

The plugin verified by Strapi The plugin verified by Strapi

A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email. A plugin works together with Strapi User Permissions Plugin and extends it functionality. For working with emails a plugin use Strapi Email Plugin.

Screenshot

โณ Installation

Install Strapi with this Quickstart command to create a Strapi project instantly:

# with yarn
yarn create strapi-app my-project --quickstart

# with npm/npx
npx create-strapi-app my-project --quickstart
yarn add strapi-plugin-passwordless@latest

# or

npm i -S strapi-plugin-passwordless@latest
  • After successful installation you've to build a fresh package that includes plugin UI. To archive that simply use:
yarn build && yarn develop

# or

npm run build && npm run develop
  • or just run Strapi in the development mode with --watch-admin option:
yarn develop --watch-admin

#or

npm run develop --watch-admin

The Passwordless plugin should appear in the Plugins section of Strapi sidebar after you run app again.

๐Ÿ”Œ Usage

REST API

Email user with login link

POST /api/passwordless/send-link
{
  "email": "[email protected]"
  "username": "John Bull" // username for new user
  "context": { 
    // context of authentification, optional parameter e.g. "currentUrl": "...my page..."
    ...
  }  
}

Send mail to user by username

POST /api/passwordless/send-link 
{
  "username": "John Bull"
}

Login with token

GET /api/passwordless/login?loginToken={tokenFromEmail}

Response:

{
  "jwt":  "...jwt auth token..."
  "user": {
    ...strapi user...
  },
  "context": {
    ... context, provided to sendlink, e.g. currentPage, sessionId etc.
  }
}

GraphQL API

WIP

๐Ÿ™Œ Versions

๐Ÿค Contributing

Feel free to fork and make a Pull Request to this plugin project. All the input is warmly welcome!

โญ๏ธ Show your support

Give a star if this project helped you.

License

MIT License Copyright (c) Andrey Kucherenko.

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.