定制 radiate/passwordless 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

radiate/passwordless

Composer 安装命令:

composer require radiate/passwordless

包简介

A Radiate framework package to allow users to login with a link

README 文档

README

Packagist Version GitHub license

Radiate Passwordless Login

A Radiate framework package to allow users to login with a link.

This simple package generates temporary login URLs that allow a user to login without a password.

Installation

composer require radiate/passwordless

Register the service provider in your functions.php file:

$app->register(Radiate\Passwordless\PasswordlessServiceProvider::class);

By default the package generates a REST API endpoint at /wp-json/passwordless/login but you are free to change this in the passwordless config.

wp radiate vendor:publish --tag=passwordless

Usage

Trait

You can add the PasswordlessLogin trait to your User model:

<?php

namespace Plugin\Models;

use Radiate\Database\Models\User as Model;
use Radiate\Passwordless\Traits\PasswordlessLogin;

class User extends Model
{
    use PasswordlessLogin;
}

This provides a getPasswordlessLink method. The method will generate a link for the user to login without a password.

<?php

// Redirect defaults to wp-admin.php
// expiry defaults to 5 minutes
$link = $user->getPasswordlessLink($redirect, $expiry);

Facade

If you prefer, you can use the PasswordlessLogin facade to generate the URL:

<?php

use Radiate\Passwordless\Facades\PasswordlessLogin;

$link = PasswordlessLogin::forUser($user)
    ->redirectTo('/')
    ->expiresIn(1 * MINUTE_IN_SECONDS)
    ->generate();

Disclaimer

Temporary URLs are safe from tampering HOWEVER if someone gives the link to someone else, then their entire account is compromised. Use passwordless URLs with caution.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固