Skip to content

Refactor and include SessionUserConcern in app/controllers/application_controller.rb

We include SessionUserConcern in a handful of places

Should we just include it in app/controllers/application_controller.rb so it's available in all controllers?

I also think it would be nicer if session_user was a struct rather than a hash (so we do session_user.id instead of session_user[:id])

Implementation plan

  1. Agree the above plan makes sense
  2. Remove all separate includes of SessionUserConcern
  3. Include SessionUserConcern in app/controllers/application_controller.rb

This could be as separate MR or part of the same:

  1. Convert SessionUserConcern to a struct
  2. Update all references to session_user[:x] to session_user.x

/cc @gitlab-org/developer-relations/contributor-success

Edited by 🤖 GitLab Bot 🤖