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

uclibs / application_portfolio / 25217821878

01 May 2026 02:20PM UTC coverage: 71.848% (+2.0%) from 69.82%
25217821878

Pull #421

circleci

Janell-Huyck
Handle null-like Shibboleth identity values during account provisioning.

Treat nil/null/undefined string payloads as missing when normalizing names and emails so fallback generation is reliable, and align first-login existence checks with normalized identities.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pull Request #421: WIP Libappo1 23 implement sso

107 of 114 new or added lines in 7 files covered. (93.86%)

1 existing line in 1 file now uncovered.

832 of 1158 relevant lines covered (71.85%)

21.05 hits per line

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

94.12
/app/controllers/users/sessions_controller.rb
1
# frozen_string_literal: true
2

3
require 'cgi'
2✔
4

5
module Users
2✔
6
  class SessionsController < Devise::SessionsController
2✔
7
    before_action :redirect_to_shibboleth, only: %i[new create]
2✔
8
    before_action :sign_in_with_email, only: :create
2✔
9

10
    private
2✔
11

12
    def redirect_to_shibboleth
2✔
13
      return unless Rails.configuration.x.auth.shibboleth_enabled
76✔
14

15
      target_path = "#{request.script_name}/auth/shibboleth"
2✔
16
      redirect_to "/Shibboleth.sso/Login?target=#{CGI.escape(target_path)}&forceAuthn=1",
2✔
17
                  alert: 'Please sign in using University SSO.'
18
    end
19

20
    def sign_in_with_email
2✔
21
      return if Rails.configuration.x.auth.shibboleth_enabled
60✔
22

23
      user = User.find_by(email: params.dig(:user, :email).to_s.strip.downcase)
60✔
24
      if user.present?
60✔
25
        sign_in(:user, user)
60✔
26
        redirect_to after_sign_in_path_for(user)
60✔
27
      else
NEW
28
        redirect_to new_user_session_path, alert: 'User email was not found.'
×
29
      end
30
    end
31
  end
32
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc