Allow platform admins and internal users to switch their current study group
This commit is contained in:

committed by
Sebastian Serth

parent
2e3480a068
commit
ac3dc8d30f
@ -13,6 +13,8 @@ class SessionsController < ApplicationController
|
||||
|
||||
def create
|
||||
if login(params[:email], params[:password], params[:remember_me])
|
||||
# We set the user's default study group to the "internal" group (no external id) for the given consumer.
|
||||
session[:study_group_id] = current_user.study_groups.find_by(external_id: nil)&.id
|
||||
redirect_back_or_to(:root, notice: t('.success'))
|
||||
else
|
||||
flash.now[:danger] = t('.failure')
|
||||
|
Reference in New Issue
Block a user