hyperf-http-auth icon indicating copy to clipboard operation
hyperf-http-auth copied to clipboard

how can we should store password?

Open SecretKeeper opened this issue 6 years ago • 1 comments

hello , with which method does this lib check the password?

i tried using password_hash() but it throws username or password is invalid?

here what i trying

/**
     * @PostMapping(path="/signup")
     * @param SignUp $request
     * @param User $user
     * @return Model
     */
    public function SignUp(SignUp $request, User $user): Model
    {
        return $user->query()->create([
            'username' => $request->input('username'),
            'email' => $request->input('email'),
            'password' => password_hash($request->input('password'), PASSWORD_BCRYPT)
        ]);
    }

SecretKeeper avatar Aug 19 '20 19:08 SecretKeeper

https://github.com/laravel/framework/blob/8.x/src/Illuminate/Hashing/BcryptHasher.php#L45

nfangxu avatar Sep 10 '20 04:09 nfangxu