-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link user to the sessions create to enable lookup of all sessions by user #20477
Conversation
end | ||
|
||
def link_user_to_session(request) | ||
session_id = request.session_options[:id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the code need to account for request
being nil
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should 👍
aa0665f
to
fa3c8ee
Compare
Checked commit gtanzillo@fa3c8ee with ruby 2.6.3, rubocop 0.69.0, haml-lint 0.28.0, and yamllint app/models/user.rb
|
schema changes were merged, as was #20549 |
This pull request is not mergeable. Please rebase and repush. |
Closing in favor of #20601 |
Prototype for using the sessions table to link a user to open sessions.
This change creates a
has_many
link between theusers
andsessions
tables. The approach creates the link after a user successfully authenticates, at which point the user instance and the request containing the session id are available. The nice thing about this approach is that is should work regardless of the configured session store because it doesn’t rely on the session data being present in the sessions table (as it would be for ActiveRecord::SessionStore)Depends on schema PR: TBD
Fixes: #20476