Skip to content
Browse files

Still that weird auth_logic bug

  • Loading branch information...
1 parent ece5a7c commit c5741dac3957631a075b5cae27354f89f668e281 @Sjors committed
View
1 .rvmrc
@@ -1 +0,0 @@
-rvm 1.9.2
View
4 Gemfile
@@ -1,13 +1,13 @@
source 'http://rubygems.org'
-gem 'rails', '3.0.8'
+gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'heroku'
-gem "authlogic", :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
+gem "authlogic" #, :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
# Use unicorn as the web server
# gem 'unicorn'
View
65 Gemfile.lock
@@ -1,21 +1,13 @@
-GIT
- remote: git://github.com/odorcicd/authlogic.git
- revision: a087ad0cba3c165ba22fcf176c28b6f7517931e8
- branch: rails3
- specs:
- authlogic (2.1.3)
- activesupport
-
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
- actionmailer (3.0.8)
- actionpack (= 3.0.8)
+ actionmailer (3.0.9)
+ actionpack (= 3.0.9)
mail (~> 2.2.19)
- actionpack (3.0.8)
- activemodel (= 3.0.8)
- activesupport (= 3.0.8)
+ actionpack (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
@@ -23,21 +15,24 @@ GEM
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
- activemodel (3.0.8)
- activesupport (= 3.0.8)
+ activemodel (3.0.9)
+ activesupport (= 3.0.9)
builder (~> 2.1.2)
i18n (~> 0.5.0)
- activerecord (3.0.8)
- activemodel (= 3.0.8)
- activesupport (= 3.0.8)
+ activerecord (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
- activeresource (3.0.8)
- activemodel (= 3.0.8)
- activesupport (= 3.0.8)
- activesupport (3.0.8)
+ activeresource (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ activesupport (3.0.9)
archive-tar-minitar (0.5.2)
arel (2.0.10)
+ authlogic (3.0.3)
+ activerecord (>= 3.0.7)
+ activerecord (>= 3.0.7)
builder (2.1.2)
columnize (0.3.4)
configuration (1.3.1)
@@ -65,20 +60,22 @@ GEM
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.8)
- actionmailer (= 3.0.8)
- actionpack (= 3.0.8)
- activerecord (= 3.0.8)
- activeresource (= 3.0.8)
- activesupport (= 3.0.8)
+ rails (3.0.9)
+ actionmailer (= 3.0.9)
+ actionpack (= 3.0.9)
+ activerecord (= 3.0.9)
+ activeresource (= 3.0.9)
+ activesupport (= 3.0.9)
bundler (~> 1.0)
- railties (= 3.0.8)
- railties (3.0.8)
- actionpack (= 3.0.8)
- activesupport (= 3.0.8)
+ railties (= 3.0.9)
+ railties (3.0.9)
+ actionpack (= 3.0.9)
+ activesupport (= 3.0.9)
rake (>= 0.8.7)
+ rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.9.2)
+ rdoc (3.8)
rest-client (1.6.3)
mime-types (>= 1.16)
ruby-debug-base19 (0.11.25)
@@ -102,8 +99,8 @@ PLATFORMS
ruby
DEPENDENCIES
- authlogic!
+ authlogic
heroku
- rails (= 3.0.8)
+ rails (= 3.0.9)
ruby-debug19
sqlite3
View
7 app/controllers/user_sessions_controller.rb
@@ -0,0 +1,7 @@
+class UserSessionsController < ApplicationController
+ def destroy
+ current_user_session.destroy
+ flash[:notice] = "Logout successful!"
+ redirect_to root_path
+ end
+end
View
2 app/controllers/users_controller.rb
@@ -18,7 +18,7 @@ def show
# Quick and dirty look-to-login
UserSession.create(@user, true)
-
+ debugger
redirect_to Event.first #(@user.participants.first.event)
# respond_to do |format|
View
4 app/models/user.rb
@@ -1,3 +1,5 @@
class User < ActiveRecord::Base
- acts_as_authentic
+ acts_as_authentic do |c|
+ c.validate_email_field = false
+ end
end
View
4 app/views/events/show.html.erb
@@ -13,13 +13,13 @@
<h2>Who are you?</h2>
<%= render 'users/form' %>
-<% unless current_user.present? %>
+<%# unless current_user.present? %>
<h2>Change something?</h2>
<% User.all.each do |user| %>
<%= link_to user.name, user %>
<% end %>
-<% end %>
+<%# end %>
<%#= link_to 'Edit', edit_event_path(@event) %>
<%#= link_to 'Back', events_path %>
View
2 config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-MiddleOfNowhere::Application.config.secret_token = '3f2df37d7b4844c611745c545283ca8a3d01fe353d262223bafe7d0667b97a40f7c39f8cb154400e9918d597cb6fbaf3abef5ffc7478160c6fbc101699de543f'
+MiddleOfNowhere::Application.config.secret_token = '260e5e96f6674416f131a59cd253fda0be3eecd2356c95c59efda513b1ebec1ae1834ecf4b32f74f455c8f4d14e0629bea99e771d300190af6d5c8e4bd957ca6'
View
2 config/initializers/session_store.rb
@@ -1,6 +1,6 @@
# Be sure to restart your server when you modify this file.
-MiddleOfNowhere::Application.config.session_store :active_record_store
+MiddleOfNowhere::Application.config.session_store :cookie_store, :key => '_MiddleOfNowhere_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
View
4 db/migrate/20110710010014_session_stuff.rb
@@ -1,11 +1,11 @@
class SessionStuff < ActiveRecord::Migration
def self.up
add_column :users, :persistence_token, :string
- add_column :users, :last_request_at, :datetime
+ #add_column :users, :last_request_at, :datetime
end
def self.down
- remove_column :users, :last_request_at
+ #remove_column :users, :last_request_at
remove_column :users, :persistence_token
end
end
View
5 db/schema.rb
@@ -36,12 +36,11 @@
end
create_table "users", :force => true do |t|
- t.string "name"
- t.string "email"
t.datetime "created_at"
t.datetime "updated_at"
t.string "persistence_token"
- t.datetime "last_request_at"
+ t.string "email"
+ t.string "name"
end
end
View
56 public/stylesheets/scaffold.css
@@ -1,56 +0,0 @@
-body { background-color: #fff; color: #333; }
-
-body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
-}
-
-pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
-}
-
-a { color: #000; }
-a:visited { color: #666; }
-a:hover { color: #fff; background-color:#000; }
-
-div.field, div.actions {
- margin-bottom: 10px;
-}
-
-#notice {
- color: green;
-}
-
-.field_with_errors {
- padding: 2px;
- background-color: red;
- display: table;
-}
-
-#error_explanation {
- width: 450px;
- border: 2px solid red;
- padding: 7px;
- padding-bottom: 0;
- margin-bottom: 20px;
- background-color: #f0f0f0;
-}
-
-#error_explanation h2 {
- text-align: left;
- font-weight: bold;
- padding: 5px 5px 5px 15px;
- font-size: 12px;
- margin: -7px;
- margin-bottom: 0px;
- background-color: #c00;
- color: #fff;
-}
-
-#error_explanation ul li {
- font-size: 12px;
- list-style: square;
-}

0 comments on commit c5741da

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