Skip to content

Commit

Permalink
Should re-route registration to lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
thesecretmaster committed Dec 3, 2018
1 parent cedfdda commit a8c16ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions app/helpers/authentication_helper.rb
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/views/flag_settings/index.html.erb
Expand Up @@ -7,7 +7,7 @@
<tr>
<th>Name</th>
<th>Value</th>
<% if user_signed_in? and current_user.has_role? :admin %>
<% if user_signed_in? && current_user.has_role? :admin %>
<th></th>
<% end %>
</tr>
Expand All @@ -18,7 +18,7 @@
<tr>
<td><%= flag_setting.name.humanize %> (<code><%= flag_setting.name %></code>)</td>
<td><%= flag_setting.value %></td>
<% if user_signed_in? and current_user.has_role? :admin %>
<% if user_signed_in? && current_user.has_role? :admin %>
<td><%= link_to 'Edit', edit_flag_setting_path(flag_setting) %></td>
<% end %>
</tr>
Expand All @@ -28,6 +28,6 @@

<br>

<% if user_signed_in? and current_user.has_role? :admin %>
<% if user_signed_in? && current_user.has_role? :admin %>
<%= link_to 'New Flag Setting', new_flag_setting_path %>
<% end %>

0 comments on commit a8c16ce

Please sign in to comment.