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:
- Add the route for autologin in your
routes/web.phpfile:
use Esplora\AutoLogin\AutoLogin; AutoLogin::routes();
This will register the necessary route for autologin functionality.
- 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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 esplora/auto-login 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Autologin package for Laravel 7
User registration and edit plugin, fully configurable, custom validators, autologin, double-opt-in, admin approval, IRRE configuration, resend activation mail, redirect features, support for saltedpasswords, support for salesforce. More to come!
CakePHP AutoLogin Component
Automatically login based on whitelisted IP, basic auth username or URL keys.
Symfony Bundle for automatic E-Mail sending with Login Link
Alfabank REST API integration
统计信息
- 总下载量: 2.59k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-22