clearance 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of clearance might be problematic. Click here for more details.
- data/CHANGELOG.textile +5 -0
- data/README.textile +3 -2
- data/Rakefile +3 -3
- data/lib/clearance/authentication.rb +12 -6
- data/lib/clearance/user.rb +3 -3
- metadata +4 -3
    
        data/CHANGELOG.textile
    CHANGED
    
    
    
        data/README.textile
    CHANGED
    
    | @@ -6,7 +6,7 @@ Rails authentication with email & password. | |
| 6 6 |  | 
| 7 7 | 
             
            h2. Suspenders
         | 
| 8 8 |  | 
| 9 | 
            -
            Clearance is included in "Suspenders":http://github.com/thoughtbot/suspenders, which thoughtbot uses on all of our apps. We highly recommend you try it. Suspenders is the "King Gem" in our ecosystem,  | 
| 9 | 
            +
            Clearance is included in "Suspenders":http://github.com/thoughtbot/suspenders, which thoughtbot uses on all of our apps. We highly recommend you try it. Suspenders is the "King Gem" in our ecosystem, representing what we think the current state-of-the-art is in Rails development.
         | 
| 10 10 |  | 
| 11 11 | 
             
            h2. Installation
         | 
| 12 12 |  | 
| @@ -111,7 +111,7 @@ h2. Authors | |
| 111 111 |  | 
| 112 112 | 
             
            Clearance was extracted out of "Hoptoad":http://hoptoadapp.com. We merged the authentication code from two of thoughtbot's clients' Rails apps and have since used it each time we need authentication. The following people have improved the library. Thank you!
         | 
| 113 113 |  | 
| 114 | 
            -
            Dan Croak, Mike Burns, Jason Morrison, Joe Ferris, Eugene Bolshakov, Nick Quaranto, Josh Nichols, Mike Breen, Marcel Görner, Bence Nagy, Ben Mabey, Eloy Duran, Tim Pope, Mihai Anca, Mark Cornick, Shay Arnett, Joshua Clayton, Mustafa Ekim, &  | 
| 114 | 
            +
            Dan Croak, Mike Burns, Jason Morrison, Joe Ferris, Eugene Bolshakov, Nick Quaranto, Josh Nichols, Mike Breen, Marcel Görner, Bence Nagy, Ben Mabey, Eloy Duran, Tim Pope, Mihai Anca, Mark Cornick, Shay Arnett, Joshua Clayton, Mustafa Ekim, Jon Yurek, & Anuj Dutta.
         | 
| 115 115 |  | 
| 116 116 | 
             
            h2. Questions?
         | 
| 117 117 |  | 
| @@ -121,3 +121,4 @@ h2. Suggestions, Bugs, Refactoring? | |
| 121 121 |  | 
| 122 122 | 
             
            Fork away and create a "Github Issue":http://github.com/thoughtbot/clearance/issues. Please don't send pull requests.
         | 
| 123 123 |  | 
| 124 | 
            +
             | 
    
        data/Rakefile
    CHANGED
    
    | @@ -23,12 +23,12 @@ namespace :test do | |
| 23 23 |  | 
| 24 24 | 
             
              Cucumber::Rake::Task.new(:features) do |t|
         | 
| 25 25 | 
             
                t.cucumber_opts   = "--format progress"
         | 
| 26 | 
            -
                t. | 
| 26 | 
            +
                t.profile = 'features'
         | 
| 27 27 | 
             
              end
         | 
| 28 28 |  | 
| 29 29 | 
             
              Cucumber::Rake::Task.new(:features_for_views) do |t|
         | 
| 30 30 | 
             
                t.cucumber_opts   = "--format progress"
         | 
| 31 | 
            -
                t. | 
| 31 | 
            +
                t.profile = 'features_for_views'
         | 
| 32 32 | 
             
              end
         | 
| 33 33 | 
             
            end
         | 
| 34 34 |  | 
| @@ -80,7 +80,7 @@ task :default => ['test:basic', 'test:features', | |
| 80 80 |  | 
| 81 81 | 
             
            gem_spec = Gem::Specification.new do |gem_spec|
         | 
| 82 82 | 
             
              gem_spec.name        = "clearance"
         | 
| 83 | 
            -
              gem_spec.version     = "0.8. | 
| 83 | 
            +
              gem_spec.version     = "0.8.3"
         | 
| 84 84 | 
             
              gem_spec.summary     = "Rails authentication with email & password."
         | 
| 85 85 | 
             
              gem_spec.email       = "support@thoughtbot.com"
         | 
| 86 86 | 
             
              gem_spec.homepage    = "http://github.com/thoughtbot/clearance"
         | 
| @@ -3,10 +3,17 @@ module Clearance | |
| 3 3 |  | 
| 4 4 | 
             
                def self.included(controller) # :nodoc:
         | 
| 5 5 | 
             
                  controller.send(:include, InstanceMethods)
         | 
| 6 | 
            +
                  controller.extend(ClassMethods)
         | 
| 7 | 
            +
                end
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                module ClassMethods
         | 
| 10 | 
            +
                  def self.extended(controller)
         | 
| 11 | 
            +
                    controller.helper_method :current_user, :signed_in?, :signed_out?
         | 
| 12 | 
            +
                    controller.hide_action   :current_user, :current_user=,
         | 
| 13 | 
            +
                                             :signed_in?,   :signed_out?,
         | 
| 14 | 
            +
                                             :sign_in,      :sign_out,
         | 
| 15 | 
            +
                                             :authenticate, :deny_access
         | 
| 6 16 |  | 
| 7 | 
            -
                  controller.class_eval do
         | 
| 8 | 
            -
                    helper_method :current_user, :signed_in?, :signed_out?
         | 
| 9 | 
            -
                    hide_action   :current_user, :signed_in?, :signed_out?
         | 
| 10 17 | 
             
                  end
         | 
| 11 18 | 
             
                end
         | 
| 12 19 |  | 
| @@ -73,9 +80,8 @@ module Clearance | |
| 73 80 | 
             
                    current_user = nil
         | 
| 74 81 | 
             
                  end
         | 
| 75 82 |  | 
| 76 | 
            -
                  # Store the current location.
         | 
| 77 | 
            -
                  # Display a flash message if included.
         | 
| 78 | 
            -
                  # Redirect to sign in.
         | 
| 83 | 
            +
                  # Store the current location and redirect to sign in.
         | 
| 84 | 
            +
                  # Display a failure flash message if included.
         | 
| 79 85 | 
             
                  #
         | 
| 80 86 | 
             
                  # @param [String] optional flash message to display to denied user
         | 
| 81 87 | 
             
                  def deny_access(flash_message = nil)
         | 
    
        data/lib/clearance/user.rb
    CHANGED
    
    | @@ -101,16 +101,16 @@ module Clearance | |
| 101 101 | 
             
                    encrypted_password == encrypt(password)
         | 
| 102 102 | 
             
                  end
         | 
| 103 103 |  | 
| 104 | 
            -
                  #  | 
| 104 | 
            +
                  # Set the remember token.
         | 
| 105 105 | 
             
                  #
         | 
| 106 106 | 
             
                  # @example
         | 
| 107 107 | 
             
                  #   user.remember_me!
         | 
| 108 108 | 
             
                  #   cookies[:remember_token] = {
         | 
| 109 109 | 
             
                  #     :value   => user.remember_token,
         | 
| 110 | 
            -
                  #     :expires =>  | 
| 110 | 
            +
                  #     :expires => 1.year.from_now.utc
         | 
| 111 111 | 
             
                  #   }
         | 
| 112 112 | 
             
                  def remember_me!
         | 
| 113 | 
            -
                    self.remember_token = encrypt("--#{Time.now.utc}--#{password}--")
         | 
| 113 | 
            +
                    self.remember_token = encrypt("--#{Time.now.utc}--#{password}--#{id}--")
         | 
| 114 114 | 
             
                    save(false)
         | 
| 115 115 | 
             
                  end
         | 
| 116 116 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: clearance
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              version: 0.8. | 
| 4 | 
            +
              version: 0.8.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors: 
         | 
| 7 7 | 
             
            - Dan Croak
         | 
| @@ -20,11 +20,12 @@ authors: | |
| 20 20 | 
             
            - Mihai Anca
         | 
| 21 21 | 
             
            - Mark Cornick
         | 
| 22 22 | 
             
            - Shay Arnett
         | 
| 23 | 
            +
            - Jon Yurek
         | 
| 23 24 | 
             
            autorequire: 
         | 
| 24 25 | 
             
            bindir: bin
         | 
| 25 26 | 
             
            cert_chain: []
         | 
| 26 27 |  | 
| 27 | 
            -
            date: 2009- | 
| 28 | 
            +
            date: 2009-10-21 00:00:00 -04:00
         | 
| 28 29 | 
             
            default_executable: 
         | 
| 29 30 | 
             
            dependencies: []
         | 
| 30 31 |  | 
| @@ -112,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 112 113 | 
             
            requirements: []
         | 
| 113 114 |  | 
| 114 115 | 
             
            rubyforge_project: 
         | 
| 115 | 
            -
            rubygems_version: 1.3. | 
| 116 | 
            +
            rubygems_version: 1.3.4
         | 
| 116 117 | 
             
            signing_key: 
         | 
| 117 118 | 
             
            specification_version: 3
         | 
| 118 119 | 
             
            summary: Rails authentication with email & password.
         |