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

pulibrary / tigerdata-app / b31d354f-f32c-42d8-9f2e-84ea71396506

16 Dec 2024 05:24PM UTC coverage: 83.419% (-0.9%) from 84.289%
b31d354f-f32c-42d8-9f2e-84ea71396506

Pull #875

circleci

carolyncole
Adding the concept of a System Login and an Active Web Login
Pull Request #875: Getting an extra cas ticket that we could theoretically pass along to mediaflux

4 of 4 branches covered (100.0%)

48 of 75 new or added lines in 8 files covered. (64.0%)

9 existing lines in 2 files now uncovered.

2274 of 2726 relevant lines covered (83.42%)

364.38 hits per line

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

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

7
    set_cas_session
3✔
8

9
    if @user.nil? && access_token&.provider == "cas"
3✔
10
      redirect_to help_path
1✔
11
      flash.notice = "You can not be signed in at this time."
1✔
12
    elsif @user.nil?
2✔
13
      redirect_to root_path
1✔
14
      flash.alert = "You are not a recognized CAS user."
1✔
15
    else
16
      sign_in_and_redirect @user, event: :authentication # this will throw if @user is not activated
1✔
17
    end
18
  end
19

20
  private
1✔
21

22
    def set_cas_session
1✔
23
      strategy = request.env["omniauth.strategy"]
3✔
24
      if strategy.present?
3✔
NEW
25
        service_url = strategy.append_params(mediaflux_extra_url, { url: request.referer })
×
NEW
26
        session[:cas_login_url] = strategy.login_url(service_url)
×
NEW
27
        session[:cas_validation_url] = strategy.service_validate_url(service_url, "")
×
28
      end
29
    end
30
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

© 2025 Coveralls, Inc