authlogic

Ruby on rails Authlogic gem and Password_Reset without ending in Edit

I followed this password_reset tutorial and was able to get it working. But there are a few things I don't like about it that I want to change. I'd like it to say password_reset rather than reset_passwords in the url. Which I've managed to accomplish by renaming the controller and routing it in config/routes.rb as map.resources :reset_...

Log-in through authlogic without having to fill in form every time

I have a number of Cucumber scenarios which run with capybara on a project I am working on. Most of these scenarios start with a "Given I am logged in" step. Currently my implementation of this is: visit path_to('the login page') fill_in('Username', :with => 'user') fill_in('Password', :with => 'password') click_button('Login')...

Rails 3 with Rspec2 and authlogic: Cannot spec requests & views

I'm having trouble creating specs for my views and requests. Some of my controllers use named_scope, like this: #projects_controller.rb @projects = Project.with_user( current_user) ## project.rb: scope :with_user, lambda {|u| {:joins => :client, :conditions => {:clients => {:user_id => u.id} } }} but the following spec gives an ...

Ruby on Rails Authlogic gem - Password confirmation

Following the http://github.com/binarylogic/authlogic_example how would I change it so that password confirmation is required for everything (such as for the edit user, and password reset pages) except for the registration page? I'd like the registration page to only require an email, a password and a captcha. I only want password confi...

Use authlogic to find the User record based on an associated record

Typically, with Authlogic, you would authenticate with some unique identifier (e.g. email or username) and a password. Authlogic does this by first finding the record by the identifier (User.find_by_email_address(email) or similar), then calling then .authenticate method on the returned object, which checks the password against the recor...

Mocking authlogic from shoulda with mocha

Hi, I am having trouble mocking authlogic from shoulda. I have the following test fixture: class HomeControllerTest < ActionController::TestCase context "on GET to index" do setup do activate_authlogic UserSession.stubs(:current_user).returns( user_session ) get :index end should respond_with :success ...

How to stub an users_controller | authlogic, rspec2, rails3, factory_girl

My users_controller.rb # GET /users/1/edit def edit @user = current_user #@user = User.find(params[:id]) end my sweet looking users_controller_spec.rb ( notice all my commented out attempts ) describe "Authenticated examples" do before(:each) do activate_authlogic UserSession.create Factory.build(:valid_user) end des...

authlogic perishable token can't be null

I get this erorr eerytime I try to create a user from the console. I used to be able to do this, but ever since I turned off PT maintenance, this could have become a problem. Thing is I do supply a value for the PT using Authlogic::Random.friendly_token, but it seems this value never shows up in the SQL statement. What do I need to do ...

Using authlogic, asking for email, should facebook's login window redirect a new application to it's own window?

When I ask for email permissions, my facebook popup window redirects to my site in its own window, whereas if I do not ask for email permissions the facebook window closes and my site redirects as normal... so asking for email seems to make something go wrong. I see this in myserver logs: makes this appear in my server logs: Completed ...

MySQL Users table separation (Ruby on Rails and Authlogic)

I was wondering if it would be better to have things like perishable_token (used for account validation and resetting of passwords), banned (boolean to check if the user is banned), email_verified (boolean to check if user's email has been verified) in a separate table in the database, as it will rarely ever be used. Also, I have my app...

How to disable logout on timeout with Authlogic?

Hi, I'm running a Rails web app where the authentication system is based on Authlogic and tardate's authlogic_rpx. The first one handles everything about sessions, the second one does the mapping with RPX/Janrain (which offers the users to sign in with Twitter or Facebook). All the users are always automatically logged out after a cer...

Using Authlogic to authenticate with only a username

There's this mother app which is on Java (Struts), which also handles authentication. My Rails app which is being integrated into the mother app uses authlogic. Ofcourse, the requirement is, once someone logs into the mother app, they should automatically be able to access my Rails app without signing in again. Is there any way, by usin...

Undefined method `persistence_token_changed?'

Hi, complete noob here! Despite following the Railscast authlogic tutorial step by step, I'm running into an error when I try to register a new user. NoMethodError in UsersController#create Undefined method `persistence_token_changed?' for #<User:0x23d1c54> My Users controller code is as follows: class UsersController < Applicati...

Authlogic problem in production mode: undefined local variable or method `acts_as_authentic' for class name

Hello Everyone, I'm using the AuthLogic gem in my rails app. It works fine in the development environment but when I switch to production environment, I get an error preventing the app from starting: /home/.../rails/xxx/app/models/book.rb:2: undefined local variable or method `acts_as_authentic' for Book:Class (NameError) from ...

Getting started with Authlogic -- is this what I am looking for?

I'm looking to build an application that handles authentication and authorization for a variety of smaller apps that may or may not be rails applications (e.g. some with sinatra, some with non-ruby frameworks, etc). These applications will be on separate domains. Can I do this with Authlogic? I do not want to setup a rails application f...

Authlogic Perishable Token Resetting on Failed Login

I am using the perishable token magic in authlogic to do password resets. However, it seems that the token is getting reset when a user tries to log in and fails. This is because authlogic is incrementing failed login attempts on the user record. So if the user requests a new password and then tries to log in before resetting the pass...

Authlogic issue only in migration in rails 3 project

I'm trying to run the following migration def self.up add_column :users, :perishable_token, :string User.all.each { |u| u.reset_perishable_token! } change_column :users, :perishable_token, :string, :null => false add_index :users, :perishable_token end and the u.reset_perishable_token! code behaves strangely (no retur...

How can I check if an user is logged in or not in a Rails Metal?

I use Authlogic to log the user in. Inside a Rails Metal I want to check if the user is logged in or not. Just that, I don't care who the user is. I want to avoid touching the database so I should not do UserSession.find. My main doubts: Will making use of env['rack.session'] solve that? Where is that stored? Is that secure? I'm current...

Route question regarding Authlogic and Rails 3.0.0

I upgraded an app I am working on from Rails 3.0.0.beta4 to Rails 3.0.0 and hit an unexpected error. I'm using authlogic for authentication, and after the upgrade the route for new user session form started throwing this error. undefined method `user_sessions_path' Ok, I'm using a singular controller name. Not sure what is different be...

Updating existing users with an Authlogic single_access_token

Hi all, I currently use Authlogic in a web-app to handle user authentication, but have now decided to create a limited API which would seem to require the use of a single_access_token. My question is, how can I apply the migration to existing users? I thought using something like add_column :users, :single_access_token, :string User....