@gabmelo That very repo has a README with usage instructions: https://github.com/mikemclin/laravel-wp-password?tab=readme-ov-file#usage
Nov 29, 2023
3
Level 1
Implement Wordpress Password Compare into Laravel Auth
I'm trying to do an authentication using Wordpress user table but aways I get unauthotized response. This response is because I'm not comparing passwords. The password from wp_users is hashed and the password from request it isn't.
I'm here to get some help on how to compare password with mikemclin/laravel-wp-password. I don't know where to put it.
Laravel version: 10
AuthController.php
public function login()
{
$credentials = ['user_email' => request('email'), 'user_pass' => request('password')];
if (! $token = auth()->attempt($credentials)) {
return response()->json(['error' => 'Unauthorized'], 401);
}
return $this->respondWithToken($token);
}
Please or to participate in this conversation.