• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / 942778ca-662d-4057-9a4d-0fa5822d6076

06 Oct 2025 04:39PM UTC coverage: 90.476% (-0.2%) from 90.702%
942778ca-662d-4057-9a4d-0fa5822d6076

Pull #1956

circleci

kelynch
Rubocop fixes
Pull Request #1956: WIP adding Flipflop for disabling login

3 of 6 new or added lines in 1 file covered. (50.0%)

1 existing line in 1 file now uncovered.

2660 of 2940 relevant lines covered (90.48%)

337.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.0
/app/controllers/users/omniauth_callbacks_controller.rb
1
# frozen_string_literal: true
2
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
1✔
3
  # rubocop:disable Metrics/AbcSize
4
  # rubocop:disable Metrics/MethodLength
5
  def cas
1✔
6
    access_token = request.env["omniauth.auth"]
3✔
7
    @user = User.from_cas(access_token)
3✔
8

9
    set_cas_session
3✔
10

11
    if Flipflop.disable_login? && !@user.eligible_sysadmin?
3✔
NEW
12
      Rails.logger.warn "User from CAS with netid #{access_token&.uid} tried to log in with login disabled"
×
NEW
13
      redirect_to root_path
×
NEW
14
      flash.alert = "TigerData is temporarily unavailable."
×
15
    elsif @user.nil? && access_token&.provider == "cas"
3✔
16
      Rails.logger.warn "User from CAS with netid #{access_token&.uid} was not found. Provider: cas"
1✔
17
      redirect_to help_path
1✔
18
      flash.notice = "You can not be signed in at this time."
1✔
19
    elsif @user.nil?
2✔
20
      Rails.logger.warn "User from CAS with netid #{access_token&.uid} was not found. Provider: #{access_token&.provider}"
1✔
21
      redirect_to root_path
1✔
22
      flash.alert = "You are not a recognized CAS user."
1✔
23
    else
24
      sign_in_and_redirect @user, event: :authentication
1✔
25
    end
26
  end
27
  # rubocop:enable Metrics/AbcSize
28
  # rubocop:enable Metrics/MethodLength
29

30
  private
1✔
31

32
    def set_cas_session
1✔
33
      strategy = request.env["omniauth.strategy"]
3✔
34
      if strategy.present?
3✔
35
        service_url = strategy.append_params(mediaflux_extra_url, { url: request.referer })
×
36
        session[:cas_login_url] = strategy.login_url(service_url)
×
UNCOV
37
        session[:cas_validation_url] = strategy.service_validate_url(service_url, "")
×
38
      end
39
    end
40
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc