Displaying 20 results from an estimated 40000 matches similar to: "restful authentication - filtering out login ??"
2008 May 06
12
Why before_filter is not working?
I have been scratching my head on this one for most of the day.
Hopefully someone can help explain why before_filter isn''t working for
my codes.
In my Application controller, I have this:
before_filter :login_required, :except =>
[:newacct, :create_newacct, :passwd_reset ]
def login_required
unless session[:user_id]
flash[:notice] = "Please log in"
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi,
I just installed Rails 2.0.2
[root@mymachine easyx]# ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
[root@mymachine easyrx]# gem install rails --include-dependencies
Need to update 16 gems from http://gems.rubyforge.org
................
complete
Successfully installed rails-2.0.2
[root@remandev easyrx]#
But I''m getting this error in my restful_authentication
2006 Feb 27
3
Send parameter along with method in before_filter
Hello list,
I have an app that has a very simple authorization scheme. A person can have
many roles and roles can have many people.
In my app, I''d like to do
before_filter :login_required (since no role name is provided, it accepts
any users with credentials)
before_filter :login_required ("administrator") (only accepts those with
role administrator)
before_filter
2006 Jan 29
3
SHLG and lib dir
Slowly figuring out how to get my SaltedHashLoginGenerator stuff working. The wiki page
says to put "before_filter :login_required" in the user (my "user" is "member") controller
or in ApplicationController. However, wherever I put it I get NoMethodError.
The rest of the SHLG stuff seems to be working... or at least I could get to the signup
page, register, and
2006 Oct 13
0
can you use only with skip_before_filter ?
I have a before_filter in my applicationController (application.rb) for
protecting all pages in my app:
before_filter :login_required
Then in a product controller i have a skip_filter with the only clause
to allow guest users to access that resource.
#allow access to show only if guest
skip_before_filter :login_required, :only => [ :show ]
This worked fine, allowing guest users to view
2010 May 27
3
before_filter always running in test, not in development or production mode.
I''m using Shoulda and restful_authentication on Rails3 and whenever I
run my tests a before filter for login_required is always triggered,
despite my filter being set up as:
before_filter :login_required, :only =>
[:update, :edit, :suspend, :unsuspend, :destroy, :purge]
My test is this:
context ''A guest to the site'' do
context ''on GET to
2007 Aug 15
4
nuby: how spec redirect_to at ApplicationController
Good morning rspec people!
Still rspec nuby: I must do something wrong obviously.
How can I spec about redirect_to at ApplicationController
describe ApplicationController do
it "method login_required should redirect to home path without login" do
pending "I tried to use controller.login_required.should be_redirected
and got NoMethodError with nil object
2008 Jun 13
3
before_filter order of execution
Hi
I''m trying to use before_filter to allow access to a site. Only logged
in users can view any object in the controller, but only users with a
access_level higher than 2 can view specific objects. My code is:
-----------------------------------------------------------
IN USER_CONTROLLER
before_filter :login_required
before_filter :access_granted, :only => [:destroy, :new , :edit]
2006 Apr 17
2
newbie before_filter question
I''ve successfully gotten acts_as_authenticated working. Currently the
before_filter line for my admin screen is like this:
class AdminController < ApplicationController
include AuthenticatedSystem
before_filter :login_required
Only issue I have now is that anyone logged in can access that screen.
I''d like to differentiate between a regular user and
2005 Aug 17
4
Stop an action ?
Hi.
I am working on a generic authentification system for rails (more
complete than the login generator). The way it works is you call a
method inside your action, passing the domain as a parameter (domains
are like a group of users with specific rights).
For that purpose, I need to exit the action inside this method because
it redirects to a login page if that person isn''t
2006 Aug 02
12
Authenticate with an IP address : LoginGenerator
Is there a way to authenticate with an IP address? I''m using the
LoginGenerator, but would like to bypass the "before_filter
:login_required
" if a user is in a correct IP range...
Anyone know of a solution?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 May 17
0
class filter: cannot call protected controller methods
Greetins all,
I''m rewriting a filter from the method form to a class filter.(see
below)
Problem: some controller - redirect_to - and route - *_url - methods are
protected (redirect_to, f.ex.), and cannot be called.
Is this intended?
Is there a solution workaround?
TIA
Alain
BEFORE:
-----------
before_filter :login_required, :except => [:welcome,:login]
def
2006 Mar 07
2
memcached and Joe Hosteny''s Salted Hash Login Generator
Hey,
so - I''ve been fiddling about and fell in to use Joe''s simple-yet-
painful SHLG (I shouldn''t complain... not at least I have time to
produce one :)). I just recently plugged in memcache, and- it''s not
preserving my login.
I traced the execution and it sets the output of User.authenticate (a
user AR object) into @session[''user'']
2011 Mar 30
3
Test errors in fuctional test after adding before_filter :login_required to controller
Hello,
I added the "before_filter" to my controllers to require a login of the
user.
Here''s an example of my Unit Controller with the added before_filter:
IN THE ATTACHED FILE
When executing the tests with rake test, I get different error messages.
To show you my errors, I only executed the unit controller test with the
following line:
ruby -Itest
2006 May 16
2
before_filter and the application controller
Hi there,
I''m having a bit of an issue with my before_filter. I know that the filters
put in the application.rb controller are global for all the controllers. In
my application filter I''d like to allow access to the RSS feed method in a
''member'' controller and skip the login checks that the before_filters are
currently performing.
In my application my filters
2006 Jul 29
2
Instance Variables within Controller during AJAX request
Hey all,
I''m trying to do something sorta simple...
There are three button ids: ''view'', ''build'', ''search''
My controller looks like this:
class RandomController < ApplicationController
before_filter :login_required, :except => [:index, :initialize]
def initialize
@mode = ''view''
end
def index
2007 Dec 03
2
before_filter application => exclude some other controllers
Hello again,
It''s possible to use before_filter in the application_controller, and
exclude for some methods from other controllers ?
i have a before_filter in application_controller that checks if the user
is logged, if the time hasn''t expired, ... and I want to exclude some
methods of this check, like the login. This ''login'' belongs to other
controller.
I
2008 Jun 25
2
How to escape from the before_filter for the particular acti
Hi,
We use the following code in the ApplicationController.
before_filter :login_required
Iam aware, this will be called for every action.
How to escape for the particular action?
Thanks,
Ayyanar. A
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Mar 05
4
before_filter :action_name OR :action_name
Hi there
I am wondering if we can use before_filter in the form of :action
OR :action
what i want to do is to implement one of the actions, if the first
failed, then go to the second
when i use
before_filter :action1
before_filter :action2
each method will run them, my case is that i want to check if one of
them is true and not both
any idea?
2006 May 11
1
skipping filters
I have a simple login scheme in application.rb. Something like
:requires_login is called in any controller as a before_filter. All is
good, except I''m having trouble figuring out how to make the public
login actions skip this before filter. Here''s what I have:
application.rb
skip_before_filter :requires_login, :only => [:login, :logout,
:confirm_valid_login]