samasend/laravel-needs-auto-rehash 问题修复 & 功能扩展

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

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

samasend/laravel-needs-auto-rehash

最新稳定版本:v0.9.2

Composer 安装命令:

composer require samasend/laravel-needs-auto-rehash

包简介

Automate the common password `Auth::needsRehash` routine using built-in event

README 文档

README

Build Status StyleCI Scrutinizer Code Quality Code Coverage License

This package automates the common password Hash::needsRehash routine by hooking into the built-in event system.

Use case

When a user register, Laravel uses bcrypt algorithm with a cost factor of 10 to hash passwords.

The problem is when you change the default hashing algorithm or when Laravel eventually changes the default algorithm to argon2i or PHP recommended PASSWORD_DEFAULT constant changes, and you want to keep up or simply want to upgrade the cost factor of bcrypt; your changes will only be reflected on newly registered users or when existing users change their password.

You have to implement a common routine task to upgrade users' password hash by checking Hash::needsRehash whenever the user provides a valid credential.

Prerequisites

  • PHP 7.2 or greater and 8.0.2 or greater
  • Laravel 6.x || 7.x || 8.x || 9.x || 10.x

Installation

composer require samasend/laravel-needs-auto-rehash

Basic Usage

That's it, you just need to install the package. 🚀

How does this works?

Contributing

Fork it
Create your feature branch (git checkout -b my-new-feature)
Commit your changes (git commit -am 'Add some feature')
Push to the branch (git push origin my-new-feature)
Create new Pull Request

统计信息

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

GitHub 信息

  • Stars: 66
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-20