diff --git a/app/controllers/authenticated_sessions_controller.rb b/app/controllers/authenticated_sessions_controller.rb index 998917f0f..535617440 100644 --- a/app/controllers/authenticated_sessions_controller.rb +++ b/app/controllers/authenticated_sessions_controller.rb @@ -15,6 +15,13 @@ def create else render :create, status: :unprocessable_entity end + rescue ActiveRecord::RecordInvalid + @authenticated_session = nil + if authenticated_session.save + redirect_to(current_space.presence || :root) + else + render :create, status: :unprocessable_entity + end end alias_method :update, :create