Skip to content
Browse files

Upgraded to authpwn 0.15.

  • Loading branch information...
1 parent a90a51d commit 27cc6597b830aa5e6646522f1035429568b695fa @pwnall committed Dec 11, 2013
View
2 Gemfile
@@ -27,7 +27,7 @@ gem 'jquery-rails', '>= 2.2.1'
# To use debugger
# gem 'ruby-debug'
-gem 'authpwn_rails', '>= 0.14.1'
+gem 'authpwn_rails', '>= 0.15.0'
gem 'configvars_rails', '>= 0.6.1'
gem 'gravatar-ultimate', '>= 2.0.0'
gem 'grit', git: 'https://github.com/pwnall/grit.git', branch: 'gitty'
View
4 Gemfile.lock
@@ -38,7 +38,7 @@ GEM
tzinfo (~> 0.3.37)
arel (4.0.1)
atomic (1.1.14)
- authpwn_rails (0.14.1)
+ authpwn_rails (0.15.0)
fbgraph_rails (>= 0.2.2)
rails (>= 3.2.16)
better_errors (1.0.1)
@@ -206,7 +206,7 @@ PLATFORMS
ruby
DEPENDENCIES
- authpwn_rails (>= 0.14.1)
+ authpwn_rails (>= 0.15.0)
better_errors
binding_of_caller
coffee-rails (>= 4.0.1)
View
3 app/controllers/session_controller.rb
@@ -60,6 +60,5 @@ def home_with_token(token)
self.auto_purge_sessions = true
# You shouldn't extend the session controller, so you can benefit from future
- # features, like Facebook / Twitter / OpenID integration. But, if you must,
- # you can do it here.
+ # features. But, if you must, you can do it here.
end
View
2 app/models/credential.rb
@@ -9,5 +9,5 @@ class Credential < ActiveRecord::Base
module Credentials
# Add your custom Credential types here.
-
+
end
View
6 app/models/session.rb
@@ -0,0 +1,6 @@
+# Virtual model for the information collected when a user signs in.
+class Session
+ include Authpwn::SessionModel
+
+ # Add your extensions to the Session class here.
+end
View
30 app/views/session/new.html.erb
@@ -1,9 +1,10 @@
<h2>Log in</h2>
+<% if flash[:notice] %>
+<p class="notice"><%= flash[:notice] %></p>
+<% end %>
<% if flash[:alert] %>
<p class="alert"><%= flash[:alert] %></p>
-<% elsif flash[:notice] %>
-<p class="notice"><%= flash[:notice] %></p>
<% end %>
<% if @redirect_url %>
@@ -13,29 +14,28 @@
</p>
<% end %>
-<%= form_tag session_path do %>
+<%= form_for @session, url: session_path do |f| %>
<div class="field">
- <%= label_tag :email, 'Email Address' %><br />
+ <%= f.label :email, 'Email Address' %><br />
<span class="value">
- <%= email_field_tag :email, @email, :autofocus => true,
- :required => true, :placeholder => 'your@email.com' %>
+ <%= f.email_field :email, autofocus: true, required: true,
+ placeholder: 'your@email.com' %>
</span>
</div>
<div class="field">
- <%= label_tag :password %><br />
+ <%= f.label :password %><br />
<span class="value">
- <%= password_field_tag :password %>
+ <%= f.password_field :password %>
</span>
</div>
<div class="actions">
- <%= button_tag 'Log in', :name => 'login', :value => 'requested' %>
- <%= button_tag 'Reset Password', :name => 'reset_password',
- :value => 'requested', :formaction => reset_password_session_path %>
-
- <% if @redirect_url %>
- <%= hidden_field_tag :redirect_url, @redirect_url %>
- <% end %>
+ <%= f.button 'Log in', name: 'login', value: 'requested' %>
+ <%= f.button 'Reset Password', name: 'reset_password',
+ value: 'requested', formaction: reset_password_session_path %>
</div>
+ <% if @redirect_url %>
+ <%= hidden_field_tag :redirect_url, @redirect_url %>
+ <% end %>
<% end %>
View
2 config/initializers/config_vars.rb
@@ -15,4 +15,4 @@
ConfigVars.string('ssh_host') { Socket.gethostname }
ConfigVars.string('admin_email') { 'admin@' + Socket.gethostname }
ConfigVars.string 'markdpwn', 'enabled'
-ConfigVars.string 'signup.email_check', 'enabled'
+ConfigVars.string 'signup.email_check', 'disabled'
View
4 db/migrate/20100725000001_create_users.rb
@@ -1,11 +1,11 @@
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
- t.string :exuid, :limit => 32, :null => false
+ t.string :exuid, limit: 32, null: false
t.timestamps
end
- add_index :users, :exuid, :unique => true
+ add_index :users, :exuid, unique: true
end
end
View
16 db/migrate/20100725000003_create_credentials.rb
@@ -1,20 +1,20 @@
class CreateCredentials < ActiveRecord::Migration
def change
create_table :credentials do |t|
- t.references :user, :null => false
- t.string :type, :limit => 32, :null => false
- t.string :name, :limit => 128, :null => true
+ t.references :user, null: false
+ t.string :type, limit: 32, null: false
+ t.string :name, limit: 128, null: true
- t.timestamp :updated_at, :null => false
+ t.timestamp :updated_at, null: false
- t.binary :key, :limit => 2.kilobytes, :null => true
+ t.binary :key, limit: 2.kilobytes, null: true
end
# All the credentials (maybe of a specific type) belonging to a user.
- add_index :credentials, [:user_id, :type], :unique => false
+ add_index :credentials, [:user_id, :type], unique: false
# A specific credential, to find out what user it belongs to.
- add_index :credentials, [:type, :name], :unique => true
+ add_index :credentials, [:type, :name], unique: true
# Expired credentials (particularly useful for tokens).
- add_index :credentials, [:type, :updated_at], :unique => false
+ add_index :credentials, [:type, :updated_at], unique: false
end
end
View
4 test/functional/session_controller_test.rb
@@ -66,8 +66,8 @@ class SessionControllerTest < ActionController::TestCase
assert_template :new
assert_select 'form[action=?]', session_path do
- assert_select 'input[name="email"]'
- assert_select 'input[name="password"]'
+ assert_select 'input[name=?]', 'session[email]'
+ assert_select 'input[name=?]', 'session[password]'
assert_select 'button[name="login"]'
assert_select 'button[name="reset_password"]'
end

0 comments on commit 27cc659

Please sign in to comment.
Something went wrong with that request. Please try again.