I have generated some demo user through seeders. I can login those user by oauth/token. But when I create new user. I can't login anymore. It always giving me 401 unauthorized 'invalid credentials'. I have done all research. I am testing through POSTMAN I am totally clueless. This is my register method:
$user = new User;
$user->name = ucfirst($request['name']);
$user->email = $request['email'];
$user->password = bcrypt($request['password']);
$user->save();
return response()->json('success');
This is the method executes when posting in oauth/token route provided by Laravel passport:
public function issueToken(ServerRequestInterface $request)
{
return $this->withErrorHandling(function () use ($request) {
return $this->convertResponse(
$this->server->respondToAccessTokenRequest($request, new Psr7Response)
);
});
}
Pls, help me!!