Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hellozach committed Nov 9, 2018
1 parent f8e2252 commit 15b51e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Http/Controllers/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down

0 comments on commit 15b51e4

Please sign in to comment.