Search
View: 83|Reply: 3
Print Prev. thread Next thread

How to generate and validate a random (and temporary) password in Laravel?

[ Promote this link! ]

9

!threads!

0

Friends

149

Money

member

Rank: 1

Jump to specified page
1#
Post time 2024-10-30 16:51:18 |Show the author posts only |Descending
I need to implement a method to generate a random password and then validate that the user is using the password previously generated. I really appreciate any help and guidance. Thank you all!

9

!threads!

0

Friends

149

Money

member

Rank: 1

2#
Post time 2024-10-30 16:56:24 |Show the author posts only
Edited by Stevyamda at 2024-10-30 16:59

I need to implement a method to generate a random password and then validate that the user is using the password previously generated. I really appreciate any help and guidance. Thank you all!

0

!threads!

0

Friends

4

Money

member

Rank: 1

3#
Post time 2024-10-30 17:00:53 |Show the author posts only
Use the standard authentication and give the user a random password...

0

!threads!

0

Friends

14

Money

member

Rank: 1

4#
Post time 2024-10-30 17:02:10 |Show the author posts only
Edited by JazmynParker at 2024-11-1 17:52

I used Str::random() to generate a random password—usually something like Str::random(12) for 12 characters. If you’re storing it in the database, just make sure to hash it so it’s secure. When the user enters the password, you can check it against the hashed one in the database.Sometimes, I use an online password generator to make sure the password is really random and strong. It’s a quick way to get tough passwords without a lot of extra steps. So, I think that you should check it out. Or, if you want to skip generating passwords entirely, sending a password reset link lets users set their own securely, which can save a step.
You have to log in before you can reply Login | 立即注册

Heyshell

2024-11-16 20:44 GMT+8 , Processed in 0.037977 second(s), 19 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

To Top