diff --git a/app/helpers/authentication_helper.rb b/app/helpers/authentication_helper.rb index 9e1cb3ae1..d3f29e8c2 100644 --- a/app/helpers/authentication_helper.rb +++ b/app/helpers/authentication_helper.rb @@ -7,8 +7,11 @@ def auth_url(scope, redirect_uri) end def write_auth_url - config = AppConfig['stack_exchange'] - auth_url('write_access,no_expiry', config['redirect_uri']) + config = AppConfig['token_store'] + state = Rails.cache.fetch("token_migration_state/#{current_user.id}", expires_in: 30.minutes) do + SecureRandom.hex(10) + end + "#{config['host']}/auth?state=#{state}" end def identify_auth_url diff --git a/app/views/flag_settings/index.html.erb b/app/views/flag_settings/index.html.erb index b048b7168..848dd9e70 100644 --- a/app/views/flag_settings/index.html.erb +++ b/app/views/flag_settings/index.html.erb @@ -7,7 +7,7 @@
<%= flag_setting.name %>
)