Skip to content

Commit

Permalink
HTTP Basic Auth was implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
tayfunoziserikan committed Aug 19, 2014
1 parent 851ec5e commit d0bcd34
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,5 +1,7 @@
class ArticlesController < ApplicationController

http_basic_authenticate_with name: 'lyk2014', password: 'secret', except: [:index, :show]

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,5 +1,7 @@
class CommentsController < ApplicationController

http_basic_authenticate_with name: 'lyk2014', password: 'secret', only: :destroy

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

0 comments on commit d0bcd34

Please sign in to comment.