Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function changePassword(){
- // Generate new Password
- $newPassword = bin2hex(openssl_random_pseudo_bytes(16/2, $crypto));
- $user = Auth::user();
- $user->password = bcrypt($newPassword);
- $user->save();
- if(Hash::check($newPassword, $user->password)){
- return response($user);
- }
- return response('Password Mismatched', 401);
- }
Add Comment
Please, Sign In to add comment