Skip to content

Commit

Permalink
show user/pass when in development environment
Browse files Browse the repository at this point in the history
  • Loading branch information
John Doe committed Oct 21, 2020
1 parent 10b27cb commit 0aa61eb
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<div class="background">
Expand All @@ -8,5 +6,32 @@
<% end %>
<% end %>

<%# Show user/pass login if in development environment so we can use test users %>
<%- if Rails.env.development? %>

<h2 style="text-align: center;">Dev environment log in</h2>
<div style="max-width: 300px; margin: auto;">
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :email %><br/>
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
</div>

<div class="field">
<%= f.label :password %><br/>
<%= f.password_field :password, autocomplete: "current-password" %>
</div>

<% if devise_mapping.rememberable? %>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
<% end %>

<div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>
</div>
<% end %>

0 comments on commit 0aa61eb

Please sign in to comment.