mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove redundant admin_login route, share with email_login
This commit is contained in:
@@ -1,61 +1,10 @@
|
||||
<% if @message %>
|
||||
<%= @message %>
|
||||
<% if @error %><p><%= @error %></p><% end %>
|
||||
|
||||
<% if @security_key_required %>
|
||||
<div id="primary-security-key-form">
|
||||
<div id="security-key-error"></div>
|
||||
<%= hidden_field_tag 'security_key_challenge', @security_key_challenge, id: 'security-key-challenge' %>
|
||||
<%= hidden_field_tag 'security_key_allowed_credential_ids', @security_key_allowed_credential_ids, id: 'security-key-allowed-credential-ids' %>
|
||||
|
||||
<%=form_tag({}, method: :put) do %>
|
||||
<p><strong><%= t('login.security_key_authenticate') %></strong></p>
|
||||
<p><%= t('login.security_key_description') %></p>
|
||||
<%= hidden_field_tag 'second_factor_method', '3' %>
|
||||
<%= hidden_field_tag 'security_key_credential', nil, id: 'security-key-credential' %>
|
||||
|
||||
<% if @second_factor_required %>
|
||||
<%= link_to t('login.security_key_alternative'), '#', id: 'activate-security-key-alternative' %><br/><br/>
|
||||
<% end %>
|
||||
<%= button_tag t('login.security_key_authenticate'), id: 'submit-security-key' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @second_factor_required %>
|
||||
<div id="second-factor-forms" style="<%= @security_key_required ? 'display: none' : '' %>">
|
||||
<div id="primary-second-factor-form">
|
||||
<%=form_tag({}, method: :put) do %>
|
||||
<br/>
|
||||
<%= label_tag(:second_factor_token, t('login.second_factor_description')) %>
|
||||
<%= render 'common/second_factor_text_field' %><br><br>
|
||||
<%= submit_tag t('submit')%>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%if @backup_codes_enabled%>
|
||||
<div id="backup-second-factor-form" style="display: none">
|
||||
<%= form_tag({}, method: :put) do%>
|
||||
<%= label_tag(:second_factor_token, t("login.second_factor_backup_description")) %>
|
||||
<%= render 'common/second_factor_backup_input' %><br><br>
|
||||
<%= submit_tag(t("submit")) %>
|
||||
<%end%>
|
||||
</div>
|
||||
<a href id="toggle-form"><%=t "login.second_factor_backup" %></a>
|
||||
<%end%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%=form_tag({}, method: :put) do %>
|
||||
<%= label_tag(:email, t('admin_login.email_input')) %>
|
||||
<%= text_field_tag(:email, nil, autofocus: true) %><br><br>
|
||||
<%= submit_tag t('admin_login.submit_button'), class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= preload_script "ember_jquery" %>
|
||||
<%= preload_script "locales/#{I18n.locale}" %>
|
||||
<%= preload_script "locales/i18n" %>
|
||||
<%= preload_script "discourse/lib/webauthn" %>
|
||||
<%= preload_script "admin-login/admin-login" %>
|
||||
<%= preload_script "admin-login/admin-login.no-module" %>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user