Skip to content

Commit

Permalink
fix: correct logging of aaf login and add to saml
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Jan 7, 2022
1 parent d8b2b11 commit 77ccee4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/api/authentication_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class AuthenticationApi < Grape::API

login_id = response.name_id || response.nameid
email = login_id

logger.info "Authenticate #{email} from #{request.ip}"

# Lookup using login_id if it exists
# Lookup using email otherwise and set login_id
# Otherwise create new
Expand Down Expand Up @@ -136,6 +139,8 @@ class AuthenticationApi < Grape::API
# Generate a temporary auth_token for future requests
onetime_token = user.generate_temporary_authentication_token!

logger.info "Redirecting #{user.username} from #{request.ip}"

# Must redirect to the front-end after sign in
protocol = Rails.env.development? ? 'http' : 'https'
host = Rails.env.development? ? "#{protocol}://localhost:3000" : Doubtfire::Application.config.institution[:host]
Expand Down Expand Up @@ -209,7 +214,7 @@ class AuthenticationApi < Grape::API
# Generate a temporary auth_token for future requests
onetime_token = user.generate_temporary_authentication_token!

logger.info "Redirecting #{username} from #{request.ip}"
logger.info "Redirecting #{user.username} from #{request.ip}"

# Must redirect to the front-end after sign in
protocol = Rails.env.development? ? 'http' : 'https'
Expand Down

0 comments on commit 77ccee4

Please sign in to comment.