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

pulibrary / orangelight / 4e01fe00-694b-47b4-8b30-2de4dc4acc66

31 Jul 2025 07:56PM UTC coverage: 92.891% (-2.5%) from 95.4%
4e01fe00-694b-47b4-8b30-2de4dc4acc66

Pull #4962

circleci

web-flow
Merge pull request #5130 from pulibrary/clean_up_scss_comments

Remove SCSS commented code.
Pull Request #4962: Orangelight pos workcycle 07-07-2025

193 of 197 new or added lines in 24 files covered. (97.97%)

161 existing lines in 35 files now uncovered.

5932 of 6386 relevant lines covered (92.89%)

1443.08 hits per line

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

59.09
/app/controllers/users/omniauth_callbacks_controller.rb
1
# frozen_string_literal: true
2

3
module Users
2✔
4
  class OmniauthCallbacksController < Devise::OmniauthCallbacksController
2✔
5
    def cas
2✔
6
      @user = User.from_cas access_token_in_request_params
1✔
7

8
      sign_in_and_redirect @user, event: :authentication # this will throw if @user is not activated
1✔
9
      if is_navigational_format?
1✔
10
        set_flash_message(:notice, :success, kind: 'from Princeton Central Authentication '\
1✔
11
                                                   'Service')
12
      end
13
    end
14

15
    def alma
2✔
UNCOV
16
      if Alma::User.authenticate(user_id: ERB::Util.url_encode(alma_params[:username]), password: alma_params[:password])
×
UNCOV
17
        @user ||= User.from_alma(access_token_in_request_params)
×
UNCOV
18
        @user.save
×
UNCOV
19
        sign_in_and_redirect @user, event: :authentication # this will throw if @user not activated
×
UNCOV
20
        set_flash_message(:notice, :success, kind: 'with alma account') if is_navigational_format?
×
21
      else
UNCOV
22
        set_flash_message(:error, :failure,
×
23
          reason: 'username or password did not match an alma account')
UNCOV
24
        redirect_to user_alma_omniauth_authorize_path(origin: omniauth_origin)
×
25
      end
26
    end
27

28
    private
2✔
29

30
      def omniauth_origin
2✔
UNCOV
31
        request.env['omniauth.origin']
×
32
      end
33

34
      # Accesses the access token passed within the request headers
35
      # @return [OmniAuth::AuthHash,nil] the access token
36
      def access_token_in_request_params
2✔
37
        request.env['omniauth.auth']
1✔
38
      end
39

40
      def alma_params
2✔
UNCOV
41
        params.permit(:username, :password)
×
42
      end
43
  end
44
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