Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ def after_sign_in_path_for(resource)
stored_location = stored_location_for(resource)
if stored_location
stored_location
elsif current_user.admin? || current_user.admin_limited_access?
manage_root_path
elsif current_user.questionnaire.nil?
new_questionnaires_path
else
Expand Down
4 changes: 0 additions & 4 deletions app/views/devise/sessions/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@
%h1.section-title.center
Sign in to
%span.emphasized= HackathonConfig['name']
- if notice
.form-success
.success_message
%p#notice= notice
= render 'form'
10 changes: 9 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@

mount MailPreview => "mail_view" if Rails.env.development?

root to: "questionnaires#show"
devise_scope :user do
authenticated do
root to: "questionnaires#show"
end

unauthenticated do
root to: "devise/sessions#new"
end
end

authenticate :user, ->(u) { u.admin? } do
mount Sidekiq::Web => "/sidekiq"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/user_flows_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class UserFlowsTest < ActionDispatch::IntegrationTest

should "be able to login and browse site as an admin" do
login(FactoryBot.create(:admin))
assert_redirected_to manage_root_path
assert_redirected_to new_questionnaires_path

get manage_dashboard_index_path
assert_response :success
Expand Down