Authenticate each request via session
This commit is contained in:
parent
c82a5897d7
commit
cb47e6bb73
3 changed files with 15 additions and 1 deletions
|
@ -1,2 +1,9 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
before_action :authenticate_user
|
||||
|
||||
private
|
||||
|
||||
def authenticate_user
|
||||
Current.user = User.find_by(id: session[:current_user_id])
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue