Skip to content

Commit

Permalink
Update authentication.rb.tt
Browse files Browse the repository at this point in the history
  • Loading branch information
gdurelle committed Sep 30, 2022
1 parent b644108 commit 7e11225
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module Authentication
end

def remember(active_session)
cookies.permanent.encrypted[:remember_token] = active_session.remember_token
cookies.permanent.encrypted[:remember_token] = { value: active_session.remember_token, httponly: true, same_site: :strict, secure: true }
end

private
Expand All @@ -44,7 +44,7 @@ module Authentication
Current.user = if session[:current_active_session_id].present?
ActiveSession.find_by(id: session[:current_active_session_id])&.user
elsif cookies.permanent.encrypted[:remember_token].present?
ActiveSession.find_by(remember_token: cookies.permanent.encrypted[:remember_token])&.user
ActiveSession.find_by(remember_token: cookies.permanent.encrypted[:remember_token].value)&.user
end
end

Expand All @@ -55,4 +55,4 @@ module Authentication
def store_location
session[:user_return_to] = request.original_url if request.get? && request.local?
end
end
end

0 comments on commit 7e11225

Please sign in to comment.