简体   繁体   English

如何将Rails密码迁移到Laravel?

[英]How can I migrate Rails passwords to Laravel?

I am migrating a Rails app to Laravel, and all that is missing now is using being able to use the old password data from Rails in Laravel. 我正在将Rails应用程序迁移到Laravel,现在所缺少的就是使用能够使用Laravel中Rails的旧密码数据。

I plan on saving the old information on a new separate column and when the user logins, compare the password with the information I got from the old Rails database, and if correct, save the password with Laravel hashing methods. 我计划将旧信息保存在新的单独列中,并在用户登录时将密码与我从旧Rails数据库中获得的信息进行比较,如果正确,请使用Laravel哈希方法保存密码。

What I would like to know is how can I check, using PHP, that the password the user submitted is the correct one from the old Rails app? 我想知道的是,如何使用PHP检查用户提交的密码是否与旧的Rails应用程序中的密码正确?

It turns out both use the same hashing system by default (bcrypt) so, nothing needs to be done if you have not modified the core password management of the frameworks. 事实证明,两者默认都使用相同的哈希系统(bcrypt),因此,如果您尚未修改框架的核心密码管理,则无需执行任何操作。

Just migrate the old password data to the new database and it should be compatible. 只需将旧密码数据迁移到新数据库,它应该兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM