mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 16:31:38 -04:00
Auth by username instead of email
Added username to User table/model
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
<h2>Sign in</h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||
<div><%= f.label :email %><br />
|
||||
<%= f.email_field :email %></div>
|
||||
<div><%= f.label :username%><br />
|
||||
<%= f.text_field :username%></div>
|
||||
|
||||
<div><%= f.label :password %><br />
|
||||
<%= f.password_field :password %></div>
|
||||
@@ -21,9 +21,9 @@
|
||||
<% if Rails.env.development? %>
|
||||
<% User.all.each do |user| %>
|
||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||
<%= f.hidden_field :email, :value => user.email %></div>
|
||||
<%= f.hidden_field :username, :value => user.username%></div>
|
||||
<%= f.hidden_field :password, :value => 'password' %></div>
|
||||
<div><%= f.submit "Sign in as #{user.email}" %></div>
|
||||
<div><%= f.submit "Sign in as #{user.username}" %></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user