Closed thombruce closed 4 years ago
See: https://github.com/thombruce/helvellyn/issues/79
Basically, this part should not exist on access token auth (currently called 'jwt'):
session = ::Session.find(token[0]['data']['session_id']) success!(session)
Instead, an ephemeral session should be initialised with Session.new that has, at least, the User from the accessToken as an attribute - providing current_session and current_user to the controller and view contexts.
Session.new
current_session
current_user
Replace with:
user = ::User.find(token[0]['data']['user_id']) session = ::Session.new(user: user) success!(session)
This will only fail if the user cannot be found.
See: https://github.com/thombruce/helvellyn/issues/79
Basically, this part should not exist on access token auth (currently called 'jwt'):
Instead, an ephemeral session should be initialised with
Session.new
that has, at least, the User from the accessToken as an attribute - providingcurrent_session
andcurrent_user
to the controller and view contexts.