cartodb/app/views/admin/client_applications/oauth.html.erb
2020-06-15 10:58:47 +08:00

93 lines
4.0 KiB
Plaintext

<% content_for(:page_title) do %>
Your OAuth credentials |
<% end %>
<%= content_for(:js) do %>
<script type="text/javascript">
var username = "<%= current_user.username %>";
var config = <%= safe_js_object frontend_config %>;
var user_data = <%= safe_js_object current_user.data.to_json %>;
var upgrade_url = "<%= current_user.upgrade_url(request.protocol) %>";
</script>
<%= editor_javascript_include_tag 'cdb.js', 'models.js', 'keys_templates.js', 'keys_deps.js', 'keys.js' -%>
<% end %>
<%= content_for(:css) do %>
<%= stylesheet_link_tag 'keys.css', :media => 'all' %>
<% end %>
<%= render :partial => 'shared/flash_message' %>
<div class="FormAccount-Section u-inner">
<%= render :partial => 'admin/shared/pages_subheader' %>
<div class="FormAccount-Content">
<div class="FormAccount-title">
<p class="FormAccount-titleText">Approve applications to act on their behalf without sharing your password</p>
</div>
<span class="FormAccount-separator"></span>
<div class="FormAccount-row">
<div class="FormAccount-rowLabel">
<label class="FormAccount-label">Consumer key</label>
</div>
<div class="FormAccount-rowData">
<input type="text" class="FormAccount-input FormAccount-input--long has-icon js-input" value="<%= current_user.client_application.key %>" readonly />
<i data-title="Copy this" class="CDB-IconFont CDB-IconFont-anchor FormAccount-inputIcon FormAccount-copyIcon js-copy-value"></i>
</div>
<div class="FormAccount-rowInfo">
<p class="FormAccount-rowInfoText">Learn more about <%= link_to "using oauth in CARTO", Cartodb.config[:developers_host] + "/cartodb-platform.html" %>.</p>
</div>
</div>
<div class="FormAccount-row">
<div class="FormAccount-rowLabel">
<label class="FormAccount-label">Consumer secret</label>
</div>
<div class="FormAccount-rowData">
<input type="text" class="FormAccount-input FormAccount-input--long has-icon js-input" value="<%= current_user.client_application.secret %>" readonly />
<i data-title="Copy this" class="CDB-IconFont CDB-IconFont-anchor FormAccount-inputIcon FormAccount-copyIcon js-copy-value"></i>
</div>
</div>
<span class="FormAccount-separator FormAccount-separator--marginTop"></span>
<div class="FormAccount-row">
<div class="FormAccount-rowLabel">
<label class="FormAccount-label">Request token URL</label>
</div>
<div class="FormAccount-rowData">
<input type="text" class="FormAccount-input FormAccount-input--long has-icon js-input" value="<%= CartoDB.url(self, 'request_token', user: current_user) %>" readonly />
<i data-title="Copy this" class="CDB-IconFont CDB-IconFont-anchor FormAccount-inputIcon FormAccount-copyIcon js-copy-value"></i>
</div>
</div>
<div class="FormAccount-row">
<div class="FormAccount-rowLabel">
<label class="FormAccount-label">Access token URL</label>
</div>
<div class="FormAccount-rowData">
<input type="text" class="FormAccount-input FormAccount-input--long has-icon js-input" value="<%= CartoDB.url(self, 'access_token', user: current_user) %>" readonly />
<i data-title="Copy this" class="CDB-IconFont CDB-IconFont-anchor FormAccount-inputIcon FormAccount-copyIcon js-copy-value"></i>
</div>
</div>
<div class="FormAccount-footer">
<p class="FormAccount-footerText">
<i class="CDB-IconFont CDB-IconFont-info FormAccount-footerIcon"></i>
<span>Learn more about location app authorization and API key management <%= link_to "here", "https://carto.com/developers/fundamentals/authorization/" %></span>
</p>
<p class="FormAccount-footerText">
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>" />
<a class="js-regenerateOauth Button Button--main" href="#"><span>Generate new keys</span></a>
</p>
</div>
</div>
</div>
<%= render 'admin/shared/new_private_footer' %>