Skip to content

Commit 7270e48

Browse files
committed
Test session brakeman fix
1 parent 5b691f8 commit 7270e48

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/controllers/test_sessions_controller.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ class TestSessionsController < ApplicationController
88
def create
99
raise 'test authorisation called outside of test environment' unless Rails.env.test?
1010

11-
user = params[:user_class].constantize.find(params[:user_id])
11+
user = if params[:user_class] == 'ExternalUser'
12+
ExternalUser.find(params[:user_id])
13+
else
14+
InternalUser.find(params[:user_id])
15+
end
16+
1217
auto_login(user)
1318
head :ok
1419
end

0 commit comments

Comments
 (0)