Skip to content

Commit bacf32d

Browse files
committed
Fix fully_authenticated? check for users when not required.
This change is required to enable the navigation menu on certain pages, e.g., the welcome page.
1 parent 3b98eef commit bacf32d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

app/controllers/application_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def current_user
3131
return @current_user if defined? @current_user
3232

3333
@current_user = find_or_login_current_user&.store_current_study_group_id(session[:study_group_id])
34+
_store_authentication_result(@current_user)
3435
end
3536

3637
def current_contributor

app/controllers/concerns/webauthn/authentication.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ def _sign_in_as(user)
114114
session[:external_user_id] = user.id
115115
end
116116

117+
_store_authentication_result(user)
118+
end
119+
120+
def _store_authentication_result(user)
121+
return unless user
122+
return user if user.fully_authenticated?
123+
117124
if user.webauthn_configured?
118125
# The user is fully authenticated if the WebAuthn authentication completed
119126
user.store_authentication_result(_webauthn_credential_authentication_completed?(user))

0 commit comments

Comments
 (0)