Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rack-devise_cookie_auth

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rack-devise_cookie_auth

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Rack::DeviseCookieAuth Build Status Dependency Status Code Climate

Rack::DeviseCookieAuth allows to log-in from a Devise remember-me token stored in a cookie.

It depends on Active::Support >= 2.3.2 and is tested against Ruby 1.9.2, 1.9.3, ruby-head and the latest versions of Rubinius & JRuby.

Installation

Add this line to your application's Gemfile (probably in the :production group only):

gem 'rack-devise_cookie_auth'

And then execute:

$ bundle

Basic Usage

If you don't use Bundler, be sure to require Rack::DeviseCookieAuth manually before actually using the middleware:

 require 'rack/devise_cookie_auth'
 use Rack::DeviseCookieAuth, secret: 'YOUR_SESSION_SECRET'

To use Rack::DeviseCookieAuth in your Rails application, add the following line to your application config file (config/application.rb or config/environments/production.rb) for Rails 3, config/environment.rb for Rails 2):

config.use Rack::DeviseCookieAuth, secret: 'YOUR_SESSION_SECRET'

# or if you're using Rack::Cache, be sure to insert Rack::DeviseCookieAuth before
config.middleware.insert_before Rack::Cache, Rack::DeviseCookieAuth, secret: 'YOUR_SESSION_SECRET'

Please note that the :secret option is mandatory and can normally be found in the 'config/initializers/secret_token.rb' file of your Rails app.

Options

Resource name

By default, the middleware will look for the user resource cookie named "remember_user_token" but if want to use authenticate againts another resource name you can set it with the :resource option:

config.middleware.use Rack::DeviseCookieAuth, secret: 'YOUR_SESSION_SECRET', resource: 'admin'

Redirection URL

By default, the middleware will redirect to the root path of the current domain but you can customize the redirection path with the :redirect_to option:

# It can be a path...
config.middleware.use Rack::DeviseCookieAuth, secret: 'YOUR_SESSION_SECRET', redirect_to: '/login'

# ... or a full URL
config.middleware.use Rack::DeviseCookieAuth, secret: 'YOUR_SESSION_SECRET', redirect_to: 'https://yourdomain.com/login'

Development

  • Documentation hosted at RubyDoc.
  • Source hosted at GitHub.

Pull requests are very welcome! Please try to follow these simple rules if applicable:

  • Please create a topic branch for every separate change you make.
  • Make sure your patches are well tested.
  • Update the README.
  • Update the CHANGELOG for noteworthy changes.
  • Please do not change the version number.

Authors

Contributors

https://github.com/jilion/rack-devise_cookie_auth/graphs/contributors

FAQs

Package last updated on 09 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc