authlogic

Following Authlogic tutorial but: undefined method `email' for #<UserSession: {:unauthorized_record=>"<protected>"}>

I followed the official Authlogic tutorial but something came up. I successfully created a user, but when I try to show his profile page, I get the following error: undefined method `email' for #<UserSession: {:unauthorized_record=>"<protected>"}> Here's the relevant code: # user.rb class User < ActiveRecord::Base acts_as_authe...

How to obtain action level protection using Authlogic and STI?

Given that it is well-documented how to use before_filter for a single user classification, I'm having trouble getting action-level protection for multiple user types. Let me explain: I've got something like this... class ApplicationController < ActionController::Base class << self attr_accessor :standard_actions end @stand...

Database write delayed in rails controller?

Hi, I'm using authlogic to generate a perishable token and send it on to the user for activation of his account, and send the mail later in a delayed job. Like so: def deliver_activation_instructions! reset_perishable_token! Notifier.send_later(:deliver_activation_instructions, self) end What I'm seeing is that the peri...

Getting undefined method `username' for #<UserSession: no credentials provided> with Authlogic after push to production

We've never gotten this app to run in production. The application runs just fine in dev. I've made sure all rake tasks are up to date and acts_as_authentic is set for the user and everything else that everyone has posted on all the forums. The server has been bounced multiple times. This error comes up every single time on all URLs. ...

declarative_authorization and authlogic problems

Hi (Disclaimer: I am very new to rails) This plugin looks like it will be a great fit for my app, but I am having a hard time getting it to work. I am using it with authlogic, I am not sure if that is the problem, but it seems like it may be. When I try an access a page that my admin role should have access to I get this: Processing C...

Authlogic: can't set password attribute from within class

I have a User model that acts_as_authentic for AuthLogic's password management. AuthLogic adds "password" and "password_confirmation" attributes over top of the db-backed "crypted_password" attribute. This is pretty standard AuthLogic stuff. I want to have a method that sets both password and password_confirmation at the same time (usef...

Shared user table with Authlogic

Hi guys, I'm looking for a solution in order to reuse the user table of another web application that use Authlogic. I'm trying with ActiveResource (in the new app), but I'm missing something. This is the not working code: #Existing app class User < ActiveRecord::Base attr_accessible :username, :email, :password acts_as_authentic...

Authenticating multiple models with Authlogic

I have multiple user account types, each with different information. For example, business contacts link to businesses, school administrators and students link to schools. Students have physical addresses, but business contacts and school admins use the organizations address. There's other information unique to each type as well. I'm le...

Authlogic and multiple sessions for the same user

Hello, I'm using Authlogic to manage the sessions in my application. However, by default, authlogic allows a user to be logged in many times from different computers. I don't want that (the user pays to get access and I want to avoid users sharing their accounts). Looking in the Authlogic documentation, I've found about the perishable_...

Authenticating against a remote service using Authlogic

I need to allow users to login to spree using a non-standard authentication service. Users in my community all have accounts on another 3d party service set up for us. That service provides a web-service that takes a login and password, and returns a userId if successful. As an admin I can then query for user profile information. I've b...

Rails: Basic Authentication with Authlogic

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 I...

How prevent a user log in twice with the same username - using Rails Authlogic?

Hi, my question is as in the title. Thanks, Michal. ...

Rails: request.xml?

Hey, I would like to check whether the request is XML od HTML. When HTML the page is redirected to login form (if a user is not logged in) and when XML the user get not authorized status code. Example: class ApplicationController < ActionController::Base def require_user unless current_user IF XML RESPOND WITH CODE...

Rest-client log in with authlogic

Hello, I am trying to use the Rest-client gem to do a few small tasks for my app which uses Authlogic to authenticate users. From Rest-Client's API, I see that one can post data necessary for the log-in process like this: require 'rest_client' RestClient.post "http://127.0.0.1:3000/user_sessions", {:user_session => {:username => 'myuser...

Rails and Authlogic. Show currently logged in user

Hi, I'm a first time authlogic implementer and everything has gone smoothly, until now. I want to display the username of the person currently logged in, beside "logout" and "edit profile" links, both of which work fine. I can't figure out how to do it though. Any help is much appreciated. Thanks. ...

authlogic single access token

Hello, I am using Single access token to do some data transfer, so far I got it to work with one action in the controller through ProjectsController private def single_access_allowed? action_name == 'index' end But I need two more actions to be allowed access with single access token, I tried to modify the line action_name == 'in...

"uninitialized constant Authlogic"

Just followed the Authlogic tutorial. I am getting "uninitialized constant Authlogic" when I try run the app. After searching, I can see that it has to do with gems/plugins but I can't find a solution. Edit: My UserSession model is: class UserSession < Authlogic::Session::Base end ...

Rails authlogic password hashing algorithm using ruby only

Does anyone know how I'd run plain text passwords through the authlogic hasing algorithm without using rails? It looks like the default for authlogic is sha512. I have a database of plain text passwords (yes, I know... bad) and need to import them into a new DB that uses the authlogic setup. This ruby script is outside of rails so I do...

Rails problem using Authlogic + acts_as_soft_deletable

So, I'm using Authlogic to manage my users and I've recently added in the act_as_soft_deletable plugin. For various reasons, I would like to be able to "undestroy!" users, but I'm getting a failure in my assert_model_soft_deletes. Here's the unit test: def test_soft_delete_works # will run the model through a destroy and undestro...

Multiple User Logins in Rails

I am working on an app right now where I have Individuals, Athletes and Coaches. A coach has many athletes and they create athletes as well. Whereas individuals can just come to the site and use a different set of tools. So for functionality and logic reasons I prefer to keep the individual model separate from the athlete model. When u...