How to implement self-owned password modification for the auth authentication provided by Laravel

Source: Internet
Author: User
Q: laravel's self-contained auth verification only supports password retrieval (sending emails and resetting passwords). now I want to change the password on my own, that's how to change the old password into a new password. In fact, I also know this logic. I only got stuck in one step: the password that comes with auth... q: laravel's self-contained auth verification only supports password retrieval (sending emails and resetting passwords). now I want to change the password on my own, that's how to change the old password into a new password. In fact, I also know this logic. I only got stuck in one step: How did I verify the self-built password encryption of auth? My use:

Bcrypt (input ('Old _ password') = old_password

But always false. what should I do? .

Reply content:

Q: laravel's self-contained auth verification only supports password retrieval (sending emails and resetting passwords). now I want to change the password on my own, that's how to change the old password into a new password. In fact, I also know this logic. I only got stuck in one step: How did I verify the self-built password encryption of auth? My use:

Bcrypt (input ('Old _ password') = old_password

But always false. what should I do? .

Your problem:AuthHow is the built-in password encryption verified?
Answer:\ Hash: check (\ Request: input ('Old _ password'), $ old_password)
(Where$ Old_passwordIs the old hash password obtained from the database)
Link to related documents: Hashing

Use the same plaintext passwordBcryptThe hash password generated by the function is different, because each time you use a differentSalt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.