diff --git a/src/Http/Controllers/BlogController.php b/src/Http/Controllers/BlogController.php index 839b404..2b8838b 100644 --- a/src/Http/Controllers/BlogController.php +++ b/src/Http/Controllers/BlogController.php @@ -42,11 +42,11 @@ public function show(Request $request, Post $post) ->latest() ->first(); - if (!isset($request->password) && $post->password && !$request->session()->get("post-pw-{$post->id}")) { + if (!$request->password && $post->password_protected && $post->password && !$request->session()->get("post-pw-{$post->id}")) { return view('gazette::password'); } - if (!$request->session()->get("post-pw-{$post->id}") && isset($request->password) && !password_verify($request->password, $post->password)) { + if ($request->password && $request->password != $post->password && !$request->session()->get("post-pw-{$post->id}")) { $error = 'Password incorrect'; return view('gazette::password', compact('error'));