authlogic

Rails 3 authentication with OpenID, Twitter or Facebook

穿精又带淫゛_ 提交于 2019-12-02 16:47:32
Can you suggest some working example of it? I tried Authlogic and Devise withous success. UPDATE - June 2011 - I have been using the omniauth gem recently and I think it is a better solution than using the gems suggested in this answer. It works well with Devise and will give you everything you need in one gem. I created an engine that combines Devise and Omniauth and adds a controller to handle the callbacks. I have quite a few changes planned for the gem and right now I don't consider it a stable plugin, but you may be able to reuse some of the code in the gem: https://github.com/charlotte

authlogic flash[:notice] does not show up in cucumber webrat step

折月煮酒 提交于 2019-12-02 10:22:49
I am running BDD steps with cucumber to implement my autlogic login behavior. Scenario: log in Given a registered user: "test@test.com" with password: "p@ssword" exists And I am on the homepage When I follow "Log in" And I fill in "Username" with "test@test.com" And I fill in "Password" with "p@ssword" And I open the page And I press "Login" And I open the page Then I should see "Login successful!" And I should see "Logout" this is my scenario and when I hit Then I should see "Login successful!" my cucumber step fails but only in webrat. I debugged with launchy and when the web-page appeard

Authlogic: getting an undefined method `password' for #<User:

怎甘沉沦 提交于 2019-12-02 05:51:25
问题 I can't seem to get my User model in Authlogic to understand the 'password' method even though I added "acts_as_authentic" to the model. This problem was also reported on the Authlogic lighthouse, but no one described how they fixed it: http://binarylogic.lighthouseapp.com/projects/18752/tickets/128-undefined-method-password-on-rails-231#ticket-128-9 The user table exists with all the required fields, and the controllers and everything else is definitely following the tutorial to the letter.

Ruby on rails - Authlogic : periodically check if user session is valid

耗尽温柔 提交于 2019-12-01 05:27:49
I'm looking for a solution allowing me to check periodically if the user session has expired and if so redirect him to the login page. I'm using Authlogic gem, so what I'm doing is call a function that make a test on current_user. My USER_SESSION_TIMEOUT is 5minutes so I make this ajax call every 5:10 minutes. <%= periodically_call_remote :url => {:controller => 'user_session', :action => 'check_session_timed_out'}, :frequency => (USER_SESSION_TIMEOUT + 10.seconds) %> def check_session_timed_out if !current_user flash[:login_notice] = "Your session timed out due to a period of inactivity.

How to manually create a new user and user session in Devise?

旧城冷巷雨未停 提交于 2019-11-29 20:45:25
I have a form where I collect a lot of information in Rails. Part of this form is fields for a new user to register. Since Devise has controllers/actions specifically to create a new user, I don't know how to programmatically create a user in an entirely different action that also creates another record. I really can't have the user registration form separate. I can't figure out how to create a user, and then log the user in, like I could easily do in Authlogic. I have used both Authlogic and Devise, and think each has their strengths and weaknesses. With Devise, I love how quick it is to "get

Migrating from Authlogic to Devise

孤街醉人 提交于 2019-11-29 18:48:52
I've previously implemented Authlogic for authorization on my site. Now however I wish to switch over to using Devise instead, and I'm wondering if anyone has any experience with this. Perhaps anyone's seen a blog post on the subject? Thank you. I myself switched from Authlogic to Devise recently and also didn't find any articles. However, in the simple case, once you've thrown away all of your user_session and other authlogic-related code, the main piece of work is converting your old users table to the format expected by devise. My old table looked like this: Column | Type | Modifiers ------

Rails: Basic Authentication with Authlogic

梦想与她 提交于 2019-11-29 08:07:37
I'm using Authlogic and I would like to implement Basic HTTP Authentication in my controller so I could define which action requires authentication. I know how to do Basic HTTP Authentication authenticate_or_request_with_http_basic an before_filter, but I would like to here from other how to implement it with Authlogic plugin. class ItemsController < ApplicationController before_filter :authenticate , :only => [:index, :create] ... end Here is a great screencast that explains, step-by-step, how to use authlogic in your rails project. Once authlogic is set up, define the following useful

Integration testing with Authlogic?

北战南征 提交于 2019-11-28 23:43:52
For the life of me I don't understand why Authlogic isn't logging me in in this integration test. I haven't had any problems w/ Authlogic logging me in in functional tests using this code. According to the authlogic rdocs ( http://tinyurl.com/mb2fp2 ), simulating a logged-in state is the same in functional & integration tests, so i'm pretty confused. any help is MUCH appreciated! class TipsController < ApplicationController before_filter :require_user, :only => [:destroy, :undelete] def destroy @tip = Tip.find(params[:id]) if can_delete?(@tip) @tip.destroy set_flash("good", "Tip deleted. <a

Migrating from Authlogic to Devise

爷,独闯天下 提交于 2019-11-28 13:45:18
问题 I've previously implemented Authlogic for authorization on my site. Now however I wish to switch over to using Devise instead, and I'm wondering if anyone has any experience with this. Perhaps anyone's seen a blog post on the subject? Thank you. 回答1: I myself switched from Authlogic to Devise recently and also didn't find any articles. However, in the simple case, once you've thrown away all of your user_session and other authlogic-related code, the main piece of work is converting your old

Ruby on Rails - request.env['HTTP_REFERER'] returns nil

拟墨画扇 提交于 2019-11-28 11:24:19
I am trying to save the http_referer so I can send the user back to that url after he has logged in. Right now I have a before_filter in my controllers that sends them to a log in page if a session has not been created via a redirect_to. However when I check the HTTP_REFERER it is nil (whereas 'REQUEST_URI' does return where Im originally coming from). Thank you. HTTP_REFERER is an HTTP header set by the browser in the request containing the the address of the previous web page from which a link to the currently requested page was followed. It will not be set when directly navigating to a page