esplora/auto-login 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

esplora/auto-login

Composer 安装命令:

composer require esplora/auto-login

包简介

Enables seamless autologin functionality via temporary links, providing convenient and secure access to your application.

README 文档

README

The AutoLogin package for Laravel enables seamless autologin functionality via temporary links. Empower your users with convenient access to your application by securely logging them in using time-limited, temporary autologin links.

Installation

You can install AutoLogin in your project using the Composer package manager:

composer require esplora/auto-login

Usage

To get started with the AutoLogin package, follow the steps below:

  1. Add the route for autologin in your routes/web.php file:
use Esplora\AutoLogin\AutoLogin;

AutoLogin::routes();

This will register the necessary route for autologin functionality.

  1. Create temporary autologin links in your controllers, emails, or other relevant places using the following methods:
AutoLogin::to('/path');
// or use named routes
AutoLogin::route('telescope', [
    'active' => '1'
]);

These methods will generate temporary links that automatically log in the user. By default, the current authenticated user will be used. However, if the code is executed in the console or in a non-authenticated context, you need to pass the user ID as the second argument:

AutoLogin::to('/path', 123);
// or use named routes
AutoLogin::route('telescope', [
    'active' => '1'
], 123);

Configuration

The AutoLogin package provides some configuration options to suit your needs. By default, the autologin URL is set to /autologin. However, if you have changed this route usage, you can specify the desired URL using the following method:

use Esplora\AutoLogin\AutoLogin;

AutoLogin::routes('/your/path/autologin');

Additionally, you can specify a Blade template to customize the autologin view. Simply pass the desired template path as the second argument:

use Esplora\AutoLogin\AutoLogin;

AutoLogin::routes('/your/path/autologin', 'path.for.your.blade.template');

In your custom template, you can access the link variable, which contains the autologin URL, and use it as needed.

<!-- path.for.your.blade.template -->

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Redirecting...</title>

    <script type="text/javascript">
      setTimeout(function () {
        window.location.href = "{{ $link }}";
      }, 3000);
    </script>
  </head>
  <body>
    <h1>You are being redirected</h1>

    <p>You will be redirected to an external page in a few seconds.</p>

    <p>
      If you are not redirected automatically, please click
      <a href="{{ $link }}">here</a>.
    </p>
  </body>
</html>

License

The MIT License (MIT). Please see License File for more information.

esplora/auto-login 适用场景与选型建议

esplora/auto-login 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.59k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2023 年 07 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「autologin」 「autoauth」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 esplora/auto-login 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 esplora/auto-login 我们能提供哪些服务?
定制开发 / 二次开发

基于 esplora/auto-login 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-22