app/controllers/application_controller.rb
# for every request, try to find the logged in user from the access token
# , and also refresh the session
for every request, try to find the logged in user from the access token
, and also refresh the session
for every request try to find the logged in user from the access token and also refresh the session
def find_session
		hashed_token = Digest::SHA2.hexdigest(params[:access_token] || "")
      	@session = Session.find_by(access_token_hashed: hashed_token)
		@session.refresh unless @session.nil? or @session.expire?
		unless @session.nil? or @session.expire?
			logger.tagged('SESSION FOUND') { logger.info "Name: #{@session.user.name} , Email: #{@session.user.email}" }
			@current_user = @session.user
		end
	end
def find_session hashed_token = Digest :: SHA2 . hexdigest ( params [ :access_token ] || "" ) @session = Session . find_by ( access_token_hashed : hashed_token ) @session . refresh unless @session . nil? or @session . expire? unless @session . nil? or @session . expire? logger . tagged ( 'SESSION FOUND' ) { logger . info "Name: #{@session.user.name} , Email: #{@session.user.email}" } @current_user = @session . user end end
for every request, try to find the logged in user from the access token
, and also refresh the session
for every request try to find the logged in user from the access token and also refresh the session