authlogic

infinite loop in authlogic rails app

坚强是说给别人听的谎言 提交于 2019-12-12 01:18:49
问题 I have a rails app with authlogic and facebook. Shortly after the first time I logged into facebook, all of my pages stopped responding and logs show Processing UserSessionsController#new (for [IP ADDRESS] at 2010-07-08 00:32:31) [GET] Parameters: {"action"=>"new", "controller"=>"user_sessions"} SystemStackError (stack level too deep): (eval):5:in `connection_handler' authlogic (2.1.5) lib/authlogic/session/callbacks.rb:83:in `validate' authlogic (2.1.5) lib/authlogic/session/validation.rb:64

authlogic UserSession.create(@user) giving unauthorized_record

独自空忆成欢 提交于 2019-12-11 14:17:56
问题 I am trying to create a session explicitly like this UserSession.create(@user, true) but the session is not getting created, current_user is nil . But when I do this, I get < #UserSession: {:unauthorized_record=>""}> us = UserSession.create(@user, true) RAILS_DEFAULT_LOGGER.info(us.inspect) #=> UserSession: {:unauthorized_record=>""} I had a look at Authlogic::Session::UnauthorizedRecord here it says Be careful with this, because Authlogic is assuming that you have already confirmed that the

Authlogic turn off require_password_confirmation for a certain case

南楼画角 提交于 2019-12-11 10:42:26
问题 I have an app that uses authlogic for login mechanism. My sign up page requires no password confirmation but password reset page does. acts_as_authentic do |a| a.require_password_confirmation = true end The above code turns on password confirmation for all the actions but which is not required in my case. It should be turned on when password reset is called and off when user signs up. Is there a way to turn this on and off on a conditional basis ? Thanks 回答1: Set password confirmation to

Display realtime list of logged in users ( Maybe using AuthLogic)

China☆狼群 提交于 2019-12-11 07:02:02
问题 I need to display a real-time or at least near real-time list of users currently logged into my site. I'm using the AuthLogic gem to manage Registration/Login & Session management. Is there a quick way for me to find a list of current usernames logged into the site using authlogic? I ask this new question because there seems to be conflicting answers on whether this is possible: Rails and Authlogic. Show currently logged in users How to get a list of online users in Authlogic? Thanks 回答1: Ok,

Redirect to previous page wherever it is directed to the login page

别等时光非礼了梦想. 提交于 2019-12-11 06:24:57
问题 I'm using Rails 3.2 and Authlogic. I have the following code: class ApplicationController < ActionController::Base private def store_location session[:return_to] = request.url end def redirect_back_or_default(default) redirect_to(session[:return_to] || default) session[:return_to] = nil end end class UserSessionsController < ApplicationController before_filter :require_no_user, :only => [:new, :create] before_filter :require_user, :only => :destroy def new @user_session = UserSession.new

Rails OpenID Authentication Plugin No Longer Installs Rake Tasks?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 03:43:05
问题 I'm following the Railscasts tutorial on using OpenID with AuthLogic. This command: $ script/plugin install git://github.com/rails/open_id_authentication.git installs the plugin, but I don't see any OpenID Rake tasks (rake -T). In particular, I can no longer run the task: $ rake open_id_authentication:db:create With previous applications, the Rake tasks were installed without a problem, so what's changed with the plugin? Which version of the plugin do I need to get the behavior I'm looking

Authlogic Create new session without password

梦想与她 提交于 2019-12-11 03:31:49
问题 I'm trying to build Facebook OAuth into my existing Authlogic login system. I have the OAuth part complete, and stored the facebook access_token. The problem I'm facing is to actually log the user in (create a session) without the user typing in their password. #facebook's OAuth callback def callback access_token = client.web_server.get_access_token(params[:code], :redirect_uri => redirect_uri) fb_user = JSON.parse(access_token.get('/me')) @user = User.find_by_facebook_id(fb_user["id"]) ||

attr_accessor causes Rspec tests to fail

我的梦境 提交于 2019-12-11 03:27:24
问题 I've added a :username_or_email property to my User model as such: class User < ActiveRecord::Base #authlogic acts_as_authentic do |c| c.login_field = :username_or_email end #virtual field for allowing a user to login with their username or email attr_accessor :username_or_email attr_accessible :username, :email, :password, :password_confirmation, :username_or_email validates :username, :presence => true, :length => { :within => 3..20 }, :uniqueness => true, :format => { :with => /\A[a-z0-9]

Custom validation messages for Session model in Authlogic

我怕爱的太早我们不能终老 提交于 2019-12-10 20:19:04
问题 What's the best way to override validation messages for login/password in the Session model in Authlogic? In the User model Authlogic provides the merge_ methods to override validation options, but Session does not have anything like that. Any suggestions? 回答1: Authlogic has it's own I18n class. Maybe it will help you? It uses by default Rails' translation mechanism so it's pretty easy to use. 来源: https://stackoverflow.com/questions/1992552/custom-validation-messages-for-session-model-in

Using authlogic with iPhone client using ASIHTTPRequest or NSURLConnection

泪湿孤枕 提交于 2019-12-10 18:58:40
问题 I am currently working on an iPhone front end for a rails service that uses vanilla authlogic for authentication. I am completely stuck on how to login to authlogic from the iPhone using ASIHTTPRequest or possibly NSURLConnection. How do I get the current user once I am already logged in? I have found many similar questions here on Stack Overflow but none of them provided good, in depth answers. Any help is greatly appreciated! 回答1: I have figured it out! Authlogic supports http basic