Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Convenience methods for use with AuthLogic and Rails. :current_user, user? etc
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Caution

This repository is deprecated and no longer maintained.# AuthLogic UserSession Helper

Bunch of convenience methods for use with AuthLogic and Rails.

Only works if you are using a standard user, and user_session.

Will be able to specify the model(s) names in the future

Install

gem install auth_logic_user_session_helper

(or use bundler)

Example

  • Get the current_user from the session current_user

  • Is there a user logged in? user?

  • Is there no user currently logged in? no_user?

  • A user is required! (use as before filter to redirect to '/login') user_required

  • A user cannot be logged in (will redirect to the root_url, whatever that is mapped to) no_user_required

  • If you need to remember what the user was trying to do before you made them login store_location redirect_back_or_default

user_required will store the requested location before redirecting.

Call redirect_back_or_default after login to enable this behaviour.

Testing

Adds login_as and logout methods to tests.

Copyright (c) 2009 [Brent Greeff], released under the MIT license