• Интеграции и плагины
  • Сообщество
  • Связаться с нами
Документация

Нужна помощь в разработке плагина интеграции для Medusa?

Написать намНайти плагины

Gorgo снижает затраты на адаптацию Medusa к локальным рынкам.

Мы разрабатываем плагины интеграции, осуществляем поддержку и развиваем сообщество разработчиков на Medusa в Telegram.

  • Ресурсы
  • Интеграции и плагины
  • Сообщество
  • Medusa Чат в Telegram
  • Medusa Новости в Telegram
  • Документация
  • Контакты
  • head@gorgojs.com
  • TelegramGitHub
MedusaПлагиныPasswordless
P

Passwordless

Passwordless authentication for Medusa

Нужна доработка этого плагина?

Связаться с нами
npm install @devx-commerce/passwordless
Категория
Авторизация
Создано
Devx Commerce
Версия
11.0.1-beta.5
Последнее обновление
4 недели назад
Ежемесячные загрузки
422
Звезды на Github
0
npmNPMGitHubGithub
MedusaПлагиныPasswordless

Features

  • 🔐 Phone number based authentication
  • 🔢 Secure verification code generation and validation
  • ⏱️ Rate limiting with maximum attempt controls
  • ⏳ Code expiration management
  • 🔌 Easy integration with existing Medusa stores

This plugin requires:

  • Medusa backend
  • Medusa framework version >= 2.7.0

Installation

  1. Install the plugin:
npm install @devx-commerce/passwordless
  1. Add the plugin to your :
{
resolve: "@medusajs/medusa/auth",
options: {
providers: [
{
resolve: `@devx-commerce/passwordless/providers/passwordless`,
id: "passwordless",
options: {
jwtSecret: "secret", // JWT secret for token generation
limeChatOptions: {
webhookUrl: process.env.LIMECHAT_WEBHOOK_URL,
typeId: process.env.LIMECHAT_TYPE_ID,
},
// Optional configuration
codeLength: 6, // Length of verification code (default: 4)
codeExpiryMinutes: 10, // Code expiration time in minutes (default: 15)
maxAttempts: 5, // Maximum verification attempts (default: 3)
smsRateLimitMinutes: 5, // Time between SMS requests in minutes (default: 10)
blockDurationMinutes: 10, // Block duration after max attempts in minutes (default: 5)
}
}
]
}
}

Configuration Options

Security Settings

  • : Length of verification code (default: 4)
  • : Code expiration time in minutes (default: 3)
  • : Maximum verification attempts (default: 3)
  • : Time between SMS requests in minutes (default: 10)
  • : Block duration after max attempts in minutes (default: 5)

How It Works

  1. Authentication Flow:

    • User provides phone number
    • System generates a secure verification code
    • User enters the code to complete authentication
  2. Security Features:

    • Rate limiting prevents abuse
    • Maximum attempt controls
    • Code expiration
    • Secure code generation

Usage

The plugin provides two main endpoints:

  1. Authentication Request
POST /auth/customer/passwordless
{
"phone": "+1234567890"
}
  1. Verification
POST /auth/customer/passwordless/callback
{
"phone": "+1234567890",
"code": "1234"
}

Phone Number Format

Phone numbers must be in E.164 format:

  • Starts with '+'
  • Country code
  • National number
  • Example: +1234567890

Error Handling

The plugin provides clear error messages for various scenarios:

  • Invalid phone number format
  • Rate limit exceeded
  • Maximum attempts exceeded
  • Invalid or expired code
  • Provider-specific errors

Еще в этой категории

Посмотреть все
Авторизация
P

Passwordless svaraa

От Devx Commerce

Passwordless authentication for Medusa

GitHubnpm
Авторизация
K

Keycloak

От Vymalo

🔐 Seamless Keycloak Identity and Access Management for MedusaJS

GitHubnpm
Авторизация
P

Passwordless x custom jw mayave

От Devx Commerce

Passwordless authentication for Medusa - JW Mayave Custom Release

GitHubnpm

Еще от этого автора

Посмотреть все
Другое
P

Plugin gati

От Devx Commerce

Gati ERP integration for Medusa

npm
CMS
S

Strapi

От Devx Commerce

Medusa plugin for Strapi as CMS

npm
Авторизация
P

Passwordless svaraa

От Devx Commerce

Passwordless authentication for Medusa

GitHubnpm