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

pulibrary / orangelight / 00dbc10b-d747-4ad7-b211-7b26d753abbb

14 Aug 2025 01:25PM UTC coverage: 0.483% (-94.9%) from 95.343%
00dbc10b-d747-4ad7-b211-7b26d753abbb

push

circleci

web-flow
Merge pull request #5181 from pulibrary/dependabot/bundler/activestorage-7.2.2.2

Bump activestorage from 7.2.2.1 to 7.2.2.2

47 of 9721 relevant lines covered (0.48%)

0.01 hits per line

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

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

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

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

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

28
    private
×
29

30
      def omniauth_origin
×
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
×
37
        request.env['omniauth.auth']
×
38
      end
×
39

40
      def alma_params
×
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