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_...
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')...
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 ...
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...
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...
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
...
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...
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 ...
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 ...
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...
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...
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...
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...
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 ...
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...
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...
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...
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...
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...
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....