https://github.com/kucherenko/strapi-plugin-passwordless
A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email.
https://github.com/kucherenko/strapi-plugin-passwordless
authentication passwordless passwordless-authentication plugin strapi strapi-plugin
Last synced: 3 months ago
JSON representation
A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email.
- Host: GitHub
- URL: https://github.com/kucherenko/strapi-plugin-passwordless
- Owner: kucherenko
- License: mit
- Created: 2022-01-03T16:24:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-17T23:04:30.000Z (12 months ago)
- Last Synced: 2025-04-06T08:42:47.913Z (3 months ago)
- Topics: authentication, passwordless, passwordless-authentication, plugin, strapi, strapi-plugin
- Language: JavaScript
- Homepage:
- Size: 461 KB
- Stars: 81
- Watchers: 5
- Forks: 26
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

![]()
# Strapi PasswordLess Plugin
[ The plugin verified by Strapi](https://market.strapi.io/plugins/strapi-plugin-passwordless)
A plugin for [Strapi Headless CMS](https://github.com/strapi/strapi) 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](https://github.com/strapi/strapi/tree/master/packages/plugins/users-permissions) and extends it functionality.
For working with emails a plugin use [Strapi Email Plugin](https://docs.strapi.io/developer-docs/latest/plugins/email.html).
## ⏳ Installation
Install Strapi with this **Quickstart** command to create a Strapi project instantly:
- (Use **yarn** to install the Strapi project (recommended). [Install yarn with these docs](https://yarnpkg.com/lang/en/docs/install/).)
```bash
# with yarn
yarn create strapi-app my-project --quickstart# with npm/npx
npx create-strapi-app my-project --quickstart
```- Configure the `Strapi email` plugin ( [official documentation](https://docs.strapi.io/developer-docs/latest/plugins/email.html) )
- Add the `strapi-plugin-passwordless` plugin
```bash
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:
```bash
yarn build && yarn develop# or
npm run build && npm run develop
```- or just run Strapi in the development mode with `--watch-admin` option:
```bash
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
- `[email protected]` - version for strapi v4
- `[email protected]` - version for strapi v3 ([dev branch](https://github.com/kucherenko/strapi-plugin-passwordless/tree/v3))## 🤝 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](LICENSE) Copyright (c) [Andrey Kucherenko](https://github.com/kucherenko).