Skip to content

Commit

Permalink
booya
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Aug 6, 2010
2 parents 9a5f506 + 552c14a commit 03e0075
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions generators/authenticated/templates/authenticated_system.rb
Expand Up @@ -68,7 +68,7 @@ def access_denied
redirect_to new_<%= controller_routing_name %>_path
end
# format.any doesn't work in rails version < http://dev.rubyonrails.org/changeset/8987
# Add any other API formats here. (Some browsers, notably IE6, send Accept: */* and trigger
# Add any other API formats here. (Some browsers, notably IE6, send Accept: */* and trigger
# the 'format.any' block incorrectly. See http://bit.ly/ie6_borken or http://bit.ly/ie6_borken2
# for a workaround.)
format.any(:json, :xml) do
Expand Down Expand Up @@ -114,7 +114,7 @@ def login_from_basic_auth
self.current_<%= file_name %> = <%= class_name %>.authenticate(login, password)
end
end

#
# Logout
#
Expand Down Expand Up @@ -149,7 +149,7 @@ def logout_killing_session!
logout_keeping_session!
reset_session
end

#
# Remember_me Tokens
#
Expand All @@ -161,25 +161,25 @@ def logout_killing_session!

def valid_remember_cookie?
return nil unless @current_<%= file_name %>
(@current_<%= file_name %>.remember_token?) &&
(@current_<%= file_name %>.remember_token?) &&
(cookies[:auth_token] == @current_<%= file_name %>.remember_token)
end

# Refresh the cookie auth token if it exists, create it otherwise
def handle_remember_cookie!(new_cookie_flag)
return unless @current_<%= file_name %>
case
when valid_remember_cookie? then @current_<%= file_name %>.refresh_token # keeping same expiry date
when new_cookie_flag then @current_<%= file_name %>.remember_me
when new_cookie_flag then @current_<%= file_name %>.remember_me
else @current_<%= file_name %>.forget_me
end
send_remember_cookie!
end

def kill_remember_cookie!
cookies.delete :auth_token
end

def send_remember_cookie!
cookies[:auth_token] = {
:value => @current_<%= file_name %>.remember_token,
Expand Down
2 changes: 1 addition & 1 deletion restful-authentication.gemspec
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.date = %q{2008-07-04}
s.description = %q{This widely-used plugin provides a foundation for securely managing user.}
s.email = %q{railsjedi@gmail.com}
s.extra_rdoc_files = ["README.makdown"]
s.extra_rdoc_files = ["README.markdown"]
s.files = ["CHANGELOG", "README.markdown", "Rakefile", "TODO", "generators/authenticated/authenticated_generator.rb", "generators/authenticated/lib/insert_routes.rb", "generators/authenticated/templates/_model_partial.html.erb", "generators/authenticated/templates/activation.erb", "generators/authenticated/templates/authenticated_system.rb", "generators/authenticated/templates/authenticated_test_helper.rb", "generators/authenticated/templates/controller.rb", "generators/authenticated/templates/helper.rb", "generators/authenticated/templates/login.html.erb", "generators/authenticated/templates/mailer.rb", "generators/authenticated/templates/migration.rb", "generators/authenticated/templates/model.rb", "generators/authenticated/templates/model_controller.rb", "generators/authenticated/templates/model_helper.rb", "generators/authenticated/templates/model_helper_spec.rb", "generators/authenticated/templates/observer.rb", "generators/authenticated/templates/signup.html.erb", "generators/authenticated/templates/signup_notification.erb", "generators/authenticated/templates/site_keys.rb", "generators/authenticated/templates/spec/controllers/access_control_spec.rb", "generators/authenticated/templates/spec/controllers/authenticated_system_spec.rb", "generators/authenticated/templates/spec/controllers/sessions_controller_spec.rb", "generators/authenticated/templates/spec/controllers/users_controller_spec.rb", "generators/authenticated/templates/spec/fixtures/users.yml", "generators/authenticated/templates/spec/helpers/users_helper_spec.rb", "generators/authenticated/templates/spec/models/user_spec.rb", "generators/authenticated/templates/stories/rest_auth_stories.rb", "generators/authenticated/templates/stories/rest_auth_stories_helper.rb", "generators/authenticated/templates/stories/steps/ra_navigation_steps.rb", "generators/authenticated/templates/stories/steps/ra_resource_steps.rb", "generators/authenticated/templates/stories/steps/ra_response_steps.rb", "generators/authenticated/templates/stories/steps/user_steps.rb", "generators/authenticated/templates/stories/users/accounts.story", "generators/authenticated/templates/stories/users/sessions.story", "generators/authenticated/templates/test/functional_test.rb", "generators/authenticated/templates/test/mailer_test.rb", "generators/authenticated/templates/test/model_functional_test.rb", "generators/authenticated/templates/test/unit_test.rb", "generators/authenticated/USAGE", "init.rb", "lib/authentication/by_cookie_token.rb", "lib/authentication/by_password.rb", "lib/authentication.rb", "lib/authorization/aasm_roles.rb", "lib/authorization/stateful_roles.rb", "lib/authorization.rb", "lib/trustification/email_validation.rb", "lib/trustification.rb", "rails/init.rb"]
s.has_rdoc = true
s.homepage = %q{http://github.com/technoweenie/restful-authentication}
Expand Down

0 comments on commit 03e0075

Please sign in to comment.