Skip to content

Commit

Permalink
[#186] Prevent creation of stories without an account
Browse files Browse the repository at this point in the history
  • Loading branch information
noahko96 committed May 19, 2022
1 parent fc3a258 commit 9ef2d65
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/adventures_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def authenticate
end

def new
if !current_user
flash[:alert] = "You must be logged in to create a story."
return redirect_to new_user_session_path
end

@adventure = Adventure.new
end

Expand Down

0 comments on commit 9ef2d65

Please sign in to comment.