diff --git a/app/controllers/api_keys_controller.rb b/app/controllers/api_keys_controller.rb
index 11277e672..8c4d36984 100644
--- a/app/controllers/api_keys_controller.rb
+++ b/app/controllers/api_keys_controller.rb
@@ -16,7 +16,7 @@ def index
sig { void }
def create
user = T.must(current_user)
- redirect_url = if Flipper.enabled?(:api_keys_in_profile)
+ redirect_url = if Flipper.enabled?(:api_keys_in_profile, current_user)
api_keys_url
else
api_howto_url
diff --git a/app/views/application/_profile_menu.html.erb b/app/views/application/_profile_menu.html.erb
index 2aa3800aa..6402867d0 100644
--- a/app/views/application/_profile_menu.html.erb
+++ b/app/views/application/_profile_menu.html.erb
@@ -2,7 +2,7 @@
<%= pa_link_to_unless_current "Your alerts", alerts_path %>
<%= pa_link_to_unless_current "Create new alert", new_alert_path %>
<%= pa_link_to_unless_current "Your comments", personal_comments_path %>
- <% if Flipper.enabled?(:api_keys_in_profile) %>
+ <% if Flipper.enabled?(:api_keys_in_profile, current_user) %>
<%= pa_link_to_unless_current "Your API keys", api_keys_path %>
<% end %>
<%= pa_link_to_unless_current "Edit account", edit_user_registration_path %>
diff --git a/app/views/documentation/api_howto.html.erb b/app/views/documentation/api_howto.html.erb
index 4c8f5e6c2..73a822268 100644
--- a/app/views/documentation/api_howto.html.erb
+++ b/app/views/documentation/api_howto.html.erb
@@ -33,7 +33,7 @@
You need an API key to try out the examples below and use the API for yourself.
- <% if Flipper.enabled?(:api_keys_in_profile) %>
+ <% if Flipper.enabled?(:api_keys_in_profile, current_user) %>
<%= render ButtonComponent.new(tag: :a, size: "xl", type: :primary, href: confirm_api_keys_path).with_content("Create API key") %>
<% else %>
<%= pa_button_to "Create API key", api_keys_path, method: :post %>