-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78a2e7c
commit cb75454
Showing
25 changed files
with
338 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2" style="margin-bottom: 40px;"> | ||
<h3><%= I18n.t('title', :scope => 'devise.otp.credentials_refresh') %></h3> | ||
<p><%= I18n.t('explain', :scope => 'devise.otp.credentials_refresh') %></p> | ||
|
||
<%= form_for(resource, :as => resource_name, :url => [:refresh, resource_name, :otp_credential], :html => { :method => :put, "data-turbo" => false }) do |f| %> | ||
|
||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<div> | ||
<%= f.label :email %><br /> | ||
<%= f.text_field :email, :disabled => :true, class: "form-control" %> | ||
</div> | ||
<br> | ||
|
||
<div> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :refresh_password, :autocomplete => :off, :autofocus => true, class: "form-control" %> | ||
</div> | ||
<br> | ||
|
||
<div><%= f.submit I18n.t(:go_on, :scope => 'devise.otp.credentials_refresh'), class: "btn btn-primary" %></div> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<div class="row"> | ||
<div class="col-md-6 col-md-offset-3" style="margin-bottom: 40px;"> | ||
|
||
<h3><%= I18n.t('title', :scope => 'devise.otp.submit_token') %></h3> | ||
<p><%= I18n.t('explain', :scope => 'devise.otp.submit_token') %></p> | ||
|
||
<%= form_for(resource, :as => resource_name, :url => [resource_name, :otp_credential], :html => { :method => :put, "data-turbo" => false }) do |f| %> | ||
|
||
<%= f.hidden_field :challenge, {:value => @challenge} %> | ||
<%= f.hidden_field :recovery, {:value => @recovery} %> | ||
|
||
<% if @recovery %> | ||
<p> | ||
<%= f.label :token, I18n.t('recovery_prompt', :scope => 'devise.otp.submit_token') %><br /> | ||
<%= f.text_field :otp_recovery_counter, :autocomplete => :off, :disabled => true, :size => 4, class: "form-control" %> | ||
</p> | ||
<% else %> | ||
<p> | ||
<%= f.label :token, I18n.t('prompt', :scope => 'devise.otp.submit_token') %><br /> | ||
</p> | ||
<% end %> | ||
|
||
<%= f.text_field :token, :autocomplete => :off, :autofocus => true, :size => 6, :value => '', class: "form-control" %><br> | ||
|
||
<!-- | ||
<%= label_tag :enable_persistence do %> | ||
<%= check_box_tag :enable_persistence, true, false %> <%= I18n.t('remember', :scope => 'devise.otp.general') %> | ||
<% end %> | ||
--> | ||
|
||
<p><%= f.submit I18n.t('submit', :scope => 'devise.otp.submit_token'), class: "btn btn-primary form-control" %></p> | ||
|
||
<% if !@recovery && recovery_enabled? %> | ||
<p class="text-center"><%= link_to I18n.t('recovery_link', :scope => 'devise.otp.submit_token'), otp_credential_path_for(resource_name, :challenge => @challenge, :recovery => true) %></p> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<% unless resource.otp_enabled? %> | ||
<hr> | ||
<p><%= I18n.t('explain', :scope => 'devise.otp.token_secret') %></p> | ||
<%= otp_authenticator_token_image(resource) %> | ||
<br/> | ||
<!-- | ||
<p> | ||
<strong><%= I18n.t('manual_provisioning', :scope => 'devise.otp.token_secret') %>:</strong> | ||
<code><%= resource.otp_auth_secret %></code> | ||
</p> | ||
--> | ||
<% end %> | ||
|
||
<% if resource.otp_enabled? %> | ||
<%- if recovery_enabled? && resource.otp_enabled_on > 10.minutes.ago %> | ||
<div class="well" style="margin: 20px auto;"> | ||
<h4><%= I18n.t('title', :scope => 'devise.otp.otp_tokens.recovery') %></h4> | ||
<p><%= I18n.t('explain', :scope => 'devise.otp.otp_tokens.recovery') %></p> | ||
<p><%= link_to I18n.t('codes_list', :scope => 'devise.otp.otp_tokens.recovery'), recovery_otp_token_for(resource_name) %></p> | ||
<p><%= link_to I18n.t('download_codes', :scope => 'devise.otp.otp_tokens.recovery'), recovery_otp_token_for(resource_name, format: :text) %></p> | ||
</div> | ||
<% end %> | ||
|
||
<%= render :partial => 'trusted_devices' if trusted_devices_enabled? %> | ||
<hr> | ||
<p> | ||
<%= I18n.t('reset_explain', :scope => 'devise.otp.token_secret') %> | ||
<strong><%= I18n.t('reset_explain_warn', :scope => 'devise.otp.token_secret') %></strong> | ||
</p> | ||
<p><%= button_to I18n.t('reset_otp', :scope => 'devise.otp.token_secret'), @resource, :method => :delete, :data => { "turbo-method": "DELETE" }, class: "btn btn-danger" %></p> | ||
<% else %> | ||
<%= form_for(resource, :as => resource_name, :url => validate_otp_path, :html => { :method => :post, "data-turbo" => false }) do |f| %> | ||
|
||
<%= f.hidden_field :challenge, {:value => @challenge} %> | ||
<%= f.hidden_field :recovery, {:value => @recovery} %> | ||
|
||
<% if @recovery %> | ||
<p> | ||
<%= f.label :token, I18n.t('recovery_prompt', :scope => 'devise.otp.submit_token') %><br /> | ||
<%= f.text_field :otp_recovery_counter, :autocomplete => :off, :disabled => true, :size => 4, class: "form-control" %> | ||
</p> | ||
<% else %> | ||
<p> | ||
<%= f.label :token, I18n.t('prompt', :scope => 'devise.otp.submit_token') %><br /> | ||
</p> | ||
<% end %> | ||
|
||
<%= f.text_field :token, :autocomplete => :off, :autofocus => true, :size => 6, :value => '', class: "form-control" %><br> | ||
<%= f.submit "Enable Two-Factor Authentication", class: "btn btn-primary form-control" %><br> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<h4><%= I18n.t('title', :scope => 'devise.otp.trusted_browsers') %></h4> | ||
<p><%= I18n.t('explain', :scope => 'devise.otp.trusted_browsers') %></p> | ||
|
||
<%- if is_otp_trusted_browser_for? resource %> | ||
<p><em class="text-success"><%= I18n.t('browser_trusted', :scope => 'devise.otp.trusted_browsers') %></em></p> | ||
<p><%= link_to I18n.t('trust_remove', :scope => 'devise.otp.trusted_browsers'), persistence_otp_token_path_for(resource_name), :method => :post, :data => { "turbo-method": "POST" } %></p> | ||
<% else %> | ||
<p><%= I18n.t('browser_not_trusted', :scope => 'devise.otp.trusted_browsers') %></p> | ||
<p><%= link_to I18n.t('trust_add', :scope => 'devise.otp.trusted_browsers'), persistence_otp_token_path_for(resource_name) %></p> | ||
<% end %> | ||
|
||
<p><%= button_to I18n.t('trust_clear', :scope => 'devise.otp.trusted_browsers'), persistence_otp_token_path_for(resource_name), :method => :delete, :data => { "turbo-method": "DELETE" }, class: "btn btn-warning" %></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2" style="margin-bottom: 40px;"> | ||
<h3><%= I18n.t('title', :scope => 'devise.otp.otp_tokens.recovery') %></h3> | ||
<p><%= I18n.t('explain', :scope => 'devise.otp.otp_tokens.recovery') %></p> | ||
|
||
<table> | ||
<caption> | ||
<thead> | ||
<tr> | ||
<th><%= I18n.t('code', :scope => 'devise.otp.otp_tokens.sequence') %></th> | ||
<th><%= I18n.t('code', :scope => 'devise.otp.otp_tokens.recovery') %></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<%- resource.next_otp_recovery_tokens.each do |seq, code| %> | ||
<tr> | ||
<td><%= seq %></td> | ||
<td><%= code %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</caption> | ||
</table> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% resource.next_otp_recovery_tokens.each do |seq, code| %> | ||
<%= code %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2" style="margin-bottom: 40px;"> | ||
<h3><%= I18n.t('title', :scope => 'devise.otp.otp_tokens') %></h3> | ||
<p><%= I18n.t('explain', :scope => 'devise.otp.otp_tokens') %></p> | ||
|
||
<%= render :partial => 'token_secret' %> | ||
</div> | ||
</div> |
20 changes: 0 additions & 20 deletions
20
app/views/devise/paranoid_verification_code/show.html.haml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.