Sha256: 4aeb02aa062d3c38a677354c61ad429733595303410c1f63e7d3a66be2f7f42e

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

### PnMerbAuthRememberMe

This plugin provides a remember me function based on MerbAuth. Most of codes are from [RestfulAuthentication on Rails](http://github.com/technoweenie/restful-authentication/tree/master)  

This plugin adds a mixin that you should include in your user model to provide 2 fields to remember the token and time to expire. The mixin will automatically select the correct sub mixin for all supported orms.  
 
<pre><code>class User
  include DataMapper::Resource
  include Merb::Authentication::Mixins::AuthenticatedUser

  property :id,    Serial
end
</code></pre>

### Migration Requirements

The mixin requires some fields to be in-place on your model.  Where needed include these in your migrations.  
<pre><code>  :remember_token_expires_at, DateTime
  :remember_token, String
</code></pre>

### Configuration Options

declare in your _merb/merb-auth/strategies.rb_ file  

    Merb::Authentication.activate!(:remember_me) 
    

------------------------------------------------------------------------------  

### Instructions for installation:

Rake tasks to package/install the gem - edit this to modify the manifest.  

file: config/dependencies.rb

\# add the plugin as a regular dependency

    dependency 'merb-auth-remember-me'

file: slice/merb-auth-slice-password/app/controllers/sessions.rb or the logout action  

\# clear :auth\_token after log out

    cookies.delete :auth_token

In your unauthenticated.html.erb(Login page)  

    %input#rememberme{ :name => "remember_me" , :type => "checkbox", :value => "1"}
        Remember Me

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scottmotte-merb-auth-remember-me-0.1.3.2 README.markdown
scottmotte-merb-auth-remember-me-0.2 README.markdown