Skip to content

Commit

Permalink
Section Basic Auth
Browse files Browse the repository at this point in the history
  • Loading branch information
James-N-M committed Oct 20, 2024
1 parent 080300b commit 0fd8f6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class ArticlesController < ApplicationController
http_basic_authenticate_with name: "dhh", password: "secret", except: [:index, :show]

Check failure on line 2 in app/controllers/articles_controller.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/SpaceInsideArrayLiteralBrackets: Use space inside array brackets.

Check failure on line 2 in app/controllers/articles_controller.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/SpaceInsideArrayLiteralBrackets: Use space inside array brackets.

def index
@articles = Article.all
end
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class CommentsController < ApplicationController
http_basic_authenticate_with name: "dhh", password: "secret", only: :destroy

def create
@article = Article.find(params[:article_id])
@comment = @article.comments.create(comment_params)
Expand Down

0 comments on commit 0fd8f6e

Please sign in to comment.