CARVIEW |
Every repository with this icon (

Every repository with this icon (

Run the following if you haven't already:
gem sources -a https://gems.github.com
Install the gem(s):
sudo gem install binarylogic-authlogic
Description: | A clean, simple, and unobtrusive ruby authentication solution. edit |
Loading…
-
Love your work. Incredibly useful.
Some suggested features and/or tutorials:
Users creates a session before creating their account, and retains their session data through the process. For example, user adds items to shopping cart before creating account, then creates account in order to buy.
System sends confirmation email to user when they create account. User clicks link in confirmation email to complete account registration process.
User edit page asks for old password before allowing user to create new password.
Comments
-
Does Authlogic could to working with Mongomapper (a wrapper to MongoDB)?
https://railstips.org/2009/6/27/mongomapper-the-rad-mongo-wrapper
Comments
-
https://github.com/binarylogic/authlogic/blob/81af95e639570822667ec817f42aaad54f8865ed/lib/authlogic/random.rb#L16
By default SecureRandom [1] uses 16 bytes (which has an entropy of 128 bits [2]), so:
SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n")
should be:
SecureRandom.base64().tr('+/=', '-_ ').rstrip
[1] https://api.rubyonrails.org/classes/ActiveSupport/SecureRandom.html#M001107
[2] https://bitbucket.org/ares/cryha/src/tip/doc/sym_crypto.txt#cl-113
https://github.com/binarylogic/authlogic/blob/81af95e639570822667ec817f42aaad54f8865ed/lib/authlogic/random.rb#L11
SecureRandom.hex(64)
Why do use 64 bytes?
It shoulds be
SecureRandom.hex()
which uses 16 random bytes to return them into a hexadecimal string.
Use hash instead of encrypted
Another thing. I've seen that it's used 'encrypted' or 'crypted' to refer to the hashs. An hash is not a cryptographic algorithm, they are both different. Please use 'hash' to refer a SHA and any term related to crypto. to refer to AES.
Comments
thedarkone Thu Jul 23 10:10:35 -0700 2009 | link
Hey kless,
I wrote the code in question. Good call with
rstrip
instead ofstrip
. I also kinda missed thatSecureRandom
already does.delete("\n")
, so that is also redundant. The reason I only use 15 bytes is because I wanted to be fully compatible with the previous ad-hoc implementation that always produced 20 character tokens.Same thing with
hex_token
, the original implementation returned 64 bytes (128 characters).Hi thedarkone,
thanks for contributing to this great plugin. This is the great thing respect to open software; whatever person to can check the code and make it better. In my case I know anything about security and I'm very strict respect to it.
Today it's very common (and recommended) to use an entropy of 128 bits (16 bytes) which it's used too in the initialization vectors (IV) of criptogaphic algorithms, and I'm sure that it's by that reason because SecureRandom returns 16 bytes by default.
So, at least for me, I think that the security is more important that the compatibility, and in this case I think that the change doesn't hurts.
In the next documents is explained any basic things about criptography and hashes:
https://bitbucket.org/ares/cryha/src/tip/doc/hash.txt
https://bitbucket.org/ares/cryha/src/tip/doc/sym_crypto.txt
Greetings!
-
Store bytes instead of string encoded in hexa./base64
0 comments Created 26 days ago by klessThe salt is being saved in base64 getting 22 chars but If it's stored as bytes strings it were only 16 chars. The difference is very great when you have 100K o 1M of users.
The same happens with the hashes which are being saved in hexadecimal, althought the difference is a lot of great.
Digest::SHA512.hexdigest => 128 chars.
instead of
Digest::SHA512.digest => 64 chars.
Comments
-
Login authentication encounters an error running Passenger 2.1.2 and Rails 2.3.3
1 comment Created 26 days ago by jdutilI am not sure if this bug is related to authlogic not being compatible with rails 2.3.3 or not, but I encounter an undefined method 'rewind' for # error when attempting to login using authlogic. This only occurs for me when attempting to use Rails 2.3.3. Once I switch back to 2.3.2 everything works fine. Here is a backtrace:
Status: 500 Internal Server Error undefined method `rewind' for #<TCPSocket:0x2536630>
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/request.rb:150:in `POST' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:15:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/params_parser.rb:15:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/session/cookie_store.rb:93:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/reloader.rb:29:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/failsafe.rb:26:in `call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `synchronize' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/dispatcher.rb:106:in `call' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/rack/request_handler.rb:65:in `process_request' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_request_handler.rb:197:in `main_loop' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:298:in `handle_spawn_application' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/utils.rb:176:in `safe_fork' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:296:in `handle_spawn_application' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `__send__' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `main_loop' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:182:in `start_synchronously' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:149:in `start' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:192:in `start' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:260:in `spawn_rails_application' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server_collection.rb:121:in `lookup_or_add' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:254:in `spawn_rails_application' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server_collection.rb:75:in `synchronize' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server_collection.rb:74:in `synchronize' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:148:in `spawn_application' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:285:in `handle_spawn_application' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `__send__' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `main_loop' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:182:in `start_synchronously' /Library/Ruby/Gems/1.8/gems/passenger-2.1.2/bin/passenger-spawn-server:50
Comments
-
I can't seem to find any information in the docs on how to remove the "_ is not valid" validations on the user session fields. generalize_credentials_error_messages did not seem to return the results I was looking for. Is there a way to remove the validations completely for email/login/password and only use the validates_presence_of. Thank you.
Comments
-
Comments
-
It would be really great with a dead simple example showing how to create an Authlogic "add on".
Comments
-
@Ben Johnsonxfrom-lighthousex|S| newx
Hi
With 2.3.3 I started to see strange ’A copy of ApplicationController has been removed from the module tree but is still active!’ errors every few requests. Switching back to 2.3.2 removed the problem.
I think I was able to locate the problem somewhere within authlogic.
It might have something to do with this outstanding ticket (https://rails.lighthouseapp.com/projects/8994/tickets/1339-arbase-should-not-be-nuking-its-children-just-because-it-lost-interest), but so far I haven’t seen any activity in it.
The problem can be reproduced by fetching my fork of the authlogic example application:
- https://github.com/retoo/authlogic_example/tree/rails233bug
- cp config/database.yml{-bug-example,} (or use your own, shoudln’t matter)
- rake db:migrate
- start server
- register a user
- fetch the page right after the registration (users/show) repeatedly and fast (keep reload button pressed)
- The error should occour withhin 10-30 requests,
Now if you like you can switch back to 2.3.2 and repeat the test, with 2.3.2 nothing happens.
Attached you can find the full backtrace.
Thanks!
Cheers,
Reto
This ticket has 1 attachment(s).
Comments
binarylogic Fri Aug 07 15:10:23 -0700 2009 | link
rails 2.3.3 problem ’ApplicationController removed from tree but still active ’
I used git bisect to locate the change within rails, and it looks like its the following change. Ben, can you judge if this is really authlogic fault or not? I think you just trigger it...
bc2c4a4 is first bad commit commit bc2c4a4 Author: Hongli Lai (Phusion) hongli@phusion.nl Date: Mon Jul 6 14:11:28 2009 +0200
Cleanup application after #close has been called on the Rack response body, not when AC::Reload#call is done. The Rack body might lazily evaluate its output, which is for example the case if one calls ’render :text => lambda { ... }’. The code which lazily evaluates the output might use other application classes. So we will want to defer cleanup until the Rack request is completely finished. Signed-off-by: Michael Koziarski <michael@koziarski.com>
:040000 040000 da0577a a75eb4b M actionpack
by Reto
binarylogic Fri Aug 07 15:10:25 -0700 2009 | link
rails 2.3.3 problem ’ApplicationController removed from tree but still active ’
Alright, looking for this commit id revealed the following two lighthouse tickets:
- https://rails.lighthouseapp.com/projects/8994/tickets/2873-application-reloading-should-be-deferred-to-end-of-request-currently-interferes-with-render-text-lambda-streaming
- https://rails.lighthouseapp.com/projects/8994/tickets/2948-exception-a-copy-of-actorscontroller-has-been-removed-from-the-module-tree-but-is-still-active
Which in turn shows to be fixed in https://github.com/rails/rails/commit/d37ac7958fc88fdbf37a8948102f6b4e45c530b3.
>Hmm, I think you can close this bug.. but I fear for me 2.3.3 is broken :(.
by Reto
-
@Ben Johnsonxerrorsxfrom-lighthousexvalidationx|S| newx
My User class has a boolean field named "enabled". I’d like to prevent the login if that field is set to false. I found here an example code:
https://rdoc.info/rdoc/binarylogic/authlogic/blob/72992b9effaea12f109465fc904fa5431538775a/Authlogic/Session/Validation/Errors.html
class UserSession
validate :check_if_awesome private def check_if_awesome errors.add(:login, "must contain awesome") if login && !login.include?("awesome") errors.add(:base, "You must be awesome to log in") unless attempted_record.awesome? end
end
that I’ve adapted into this:
class UserSession < Authlogic::Session::Base
validate :check_if_user_enabled private def check_if_user_enabled debugger # User.find_by_login(object.login).enabled end
end
so, why does UserSession doesn’t inherit from Authlogic::Session::Base ?
Moreover, using the debugger I can’t see the "errors" object, I can only access to it by "object.errors".
so, if I’m not doing anything wrong, the problem in this ticket should only be about syncing this to the documentation.
Maurizio De Magnis
This ticket has 0 attachment(s).
Comments
binarylogic Fri Aug 07 15:10:57 -0700 2009 | link
custom validation
Shame on me, it seems that only in the debugger context "errors" and the other fields are accessible through "object"..
by maurizio.demagnis (at gmail)
-
@Ben Johnsonxfrom-lighthousex|S| newx
I have a fairly generic setup of Authlogic using all defaults against a User table in my primary DB.
I have a 2nd separate database setup in my database.yml/models ala something like..
In database.yml ... a second_db entry
In an example model...
class ModelInOtherDB < ActiveRecord::Base
establish_connection :second_db ... endWhenever I use this MonelInOtherDB .. it works but when I reload the authlogic tries hitting the 2nd database not the primary DB with the User in it and faults with a ...
Could not find table ’user’ error
Authlogic(2.1.1)
Ruby version 1.9.1 (i386-darwin9.6.0)
RubyGems version 1.3.3This ticket has 0 attachment(s).
Comments
-
@Ben Johnsonxcookiesxfrom-lighthousexsessionx|S| openx
View
@@@ - if current_user %p= "Signed in as " << current_user.email << "!" %p= current_user_session.remember_me? - else %h1 Login %p
- form_for :login_info, :url => login_path do |f| = f.label :email = f.text_field :email = f.label :password = f.password_field :password = f.submit "Submit" = f.check_box :remember_me = f.label :remember_me
@@@
Controller
@@@ class UserSessionsController < ApplicationController before_filter :require_no_user, :only => :create before_filter :require_user, :only => :destroy
def create
user_session = UserSession.new(params[:login_info]) if user_session.save flash[:notice] = "Logged in!" redirect_to home_path else flash[:error] = "Error: Login unsuccessful!" redirect_to home_path end
end
def destroy
current_user_session.destroy flash[:notice] = "Logged out!" redirect_to home_path
end end @@@
Problem
Now when I login with the option ’Remember me?’ checked, Rails passes: @@@ Processing UserSessionsController#create (for 127.0.0.1 at 2009-07-11 03:39:15) [POST] Parameters: {"commit"=>"Submit", "action"=>"create", "controller"=>"user_sessions", "login_info"=>{"password"=>"[FILTERED]", "remember_me"=>"1", "email"=>"c00lryguy@gmail.com"}} @@@
But the View displays: @@@ Signed in as c00lryguy@gmail.com! false @@@
No matter how hard I try I can’t get the current_user_session to remember the remember_me option.
This ticket has 0 attachment(s).
Comments
binarylogic Fri Aug 07 15:11:46 -0700 2009 | link
:remember_me option not saving with UserSession.new
That’s strange. The remember_me feature uses a cookie. Are you sure that cookies are properly being created? Try doing a simple test where you expire a cookie in the future, close your browser, and see if you can still retrieve that cookie. I can’t tell you how many times people have an issue with authlogic when their cookies aren’t working properly.
I’m using the remember_me function on a number of sites I manage and all are working great.
Hope this helps.
by Ben Johnson
binarylogic Fri Aug 07 15:11:55 -0700 2009 | link
:remember_me option not saving with UserSession.new
While logged with with the Remember me? option checked, I viewed my cookies in Firefox and there’s nothing no ’remember_me’ cookie. I see no reason why it wouldn’t create the ’remember_me’ cookie since it also creates session and user_credentials cookies.
by c00lryguy
binarylogic Fri Aug 07 15:11:58 -0700 2009 | link
:remember_me option not saving with UserSession.new
Do you have some sort of example app using the remember_me option?
by c00lryguy
binarylogic Fri Aug 07 15:12:00 -0700 2009 | link
:remember_me option not saving with UserSession.new
I’m having the same problem here but I can get the remember_me to be true on the current_user_session.
I don’t have any remeber_me cookie created either.... will keep work on it...
Thanks
by Philippe René
binarylogic Fri Aug 07 15:12:04 -0700 2009 | link
:remember_me option not saving with UserSession.new
I have a related problem that is puzzling me.
I decided to keep things simple and have every session ’remembered’. I added a line to my UserSession model:
class UserSession < Authlogic::Session::Base remember_me true end
This works great in development, but doesn’t seem to work in production. I see the cookie, but it is set to expire at the end of the browser session.
Any thoughts??
Thanks
by Phil McT
binarylogic Fri Aug 07 15:12:06 -0700 2009 | link
:remember_me option not saving with UserSession.new
Sorry, the code snipped there is:
@@@ class UserSession < Authlogic::Session::Base remember_me true end @@@
by Phil McT
binarylogic Fri Aug 07 15:12:10 -0700 2009 | link
:remember_me option not saving with UserSession.new
Oh for an post edit feature!!
Last try:
@@@ class UserSession < Authlogic::Session::Base remember_me true end @@@
by Phil McT
binarylogic Fri Aug 07 15:12:14 -0700 2009 | link
:remember_me option not saving with UserSession.new
I messed around for a bit. Looks like unpacking the gem fixed the problem. My host has authlogic installed, looks like the same version, so I don’t know exactly what happened. But it’s working for me now.
Thanks for the plugin, cool stuff.
by Phil McT
-
from-lighthousex|S| newx
I’m using authlogic_openid version 1.0.4 because of problems with the current version of authlogic_openid. The error exists in the demo at https://authlogicexample.binarylogic.com/ as well.
Visit the demo. Enter https://google.com (or some other non-OpenID aware URL).
The problem is that the save block never gets yielded to. Here is the Mongrel output from my development environment: [OPENID] No usable OpenID services were found for "https://google.com/"
A similar problem exists when a URL to a non-existing server is entered: [OPENID] Failed to fetch identity URL https://b.com/ : Error fetching https://b.com/: getaddrinfo: Name or service not known
Best,
Daniel
This ticket has 0 attachment(s).
Comments
binarylogic Fri Aug 07 15:12:39 -0700 2009 | link
Authlogic_openid fails with URL that doesn’t lead to an OpenID aware server
I have similar bug.
by petRUShka
-
@Ben Johnsonxfrom-lighthousexhttp_basic_authenticationx|S| newx
HTTP Basic authentication works when going through curl, but not when using a browser (safari or firefox). In firefox, the attached dialog shows up. This happens in all of my projects using authlogic and the authlogic_example application from github. It’s the same whether I use mongrel or passenger.
This ticket has 2 attachment(s).
Comments
-
@Ben Johnsonxfrom-lighthousex|S| openx
I added a translations file for AuthLogic to my rails app. This correctly resulted in error messages for users being translated into the default locale. However, when I change the locale in a before filter, AuthLogic keeps returning error messages in the default locale while AR starts providing validation errors in the current locale. It seems like the call to I18n translate (t) is being made only once with the default locale when the AuthLogic gem is loaded.
This ticket has 0 attachment(s).
Comments
binarylogic Fri Aug 07 15:13:17 -0700 2009 | link
I18n locale changes work for AR but not AL
I see what you are saying. This should only be an issue for configuration items. What I’ll do instead is store the key and have authlogic process this upon request.
by Ben Johnson
binarylogic Fri Aug 07 15:13:20 -0700 2009 | link
I18n locale changes work for AR but not AL
Could you give an update on the status of this bug? I’m having similar problems.
by Tom-Eric
-
@Ben Johnsonxauthlogici18nxdocumentationxfrom-lighthousexi18nxrdocx|S| newx
Hey there.
Ran into a couple of problems customising the error messages that Authlogic raises using the I18n functionality, stemming from a couple of inaccuracies in your RDOC.
Firstly, this example (from https://rdoc.info/rdoc/binarylogic/authlogic/blob/81af95e639570822667ec817f42aaad54f8865ed/Authlogic/I18n.html):
>START CODE
module MyAuthlogicI18nAdapter
def t(key, options = {})
# you will have key which will be something like: "error_messages.password_invalid" # you will also have options[:default], which will be the default english version of the message # do whatever you want here with the arguments passed to you.
end
end
Authlogic::I18n.extend MyAuthlogicI18nAdapter
END CODE
..contains a subtle misunderstanding of how Object#extend works, and of Ruby’s OO semantics in general. In a nutshell, extend places the module with which your object is being extended in the inheritance tree above it, rather than overriding the methods on the object itself (The object in this place being the Authlogic::I18n singleton class). In practical terms, this means that if your object already has a method of the same name as one defined by the module (as is true in this case - Authlogic::I18n defines its own self.t method), the object’s own implementation will still be called, as it is lower down in the inheritance tree than that in the module with which it is being extended.
However, this is pretty much a moot point, as, looking at the source in i18n.rb - the built-in Authlogic::I18n.t attempts to call the t method on a top-level class called I18n, so a simpler method of overriding auth messages is simply to define that top-level I18n class itself, with a t method (no need for that extend). As a further improvement, i might suggest making this top-level classname configurable, as I18n seems pretty generic and potentially prone to namespace clashes. However, if the documentation for this feature could be updated to correct this, that’d be great.
Cheers!
Tim
This ticket has 0 attachment(s).
Comments
-
@Ben Johnsonxfrom-lighthousexi18nx|S| newx
Hello, I think there still are some keys missing.
I can’t translate during validation :
model names :
user_session user
attributes :
all the attributes for user
The rest is working just fine.
I’m using the latest gem.
This ticket has 0 attachment(s).
Comments
binarylogic Fri Aug 07 15:14:10 -0700 2009 | link
some i18n keys missing?
My locale file looks like this : @@@ fr: authlogic:
error_messages: login_blank: ne peut être vide login_not_found: n’existe pas login_invalid: ne doit utiliser que des lettres, des chiffres, des espaces et .-_@ consecutive_failed_logins_limit_exceeded: Trop d’échecs d’authentification consécutifs, le compte est désactivé. email_invalid: "doit ressembler à une adresse email. Ex : votre-nom@lefigaro.fr" password_blank: ne peut être vide password_invalid: n’est pas valide not_active: Votre compte n’est pas actif not_confirmed: Votre compte n’est pas validé not_approved: Votre compte n’est pas approuvé no_authentication_details: Vous n’avez fourni aucune information permettant votre authentification models: user_session: UserSession user: User attributes: user_session: username: le nom d’utilisateur login: le nom d’utilisateur email: l’email password: le mot de passe remember_me: "se souvenir de moi" user: username: le nom d’utilisateur email: "l’email" password: le mot de passe
@@@
My two AuthLogic related models are :
UserSession & User
by Benoit B.
-
@Ben Johnsonxauthlogicxfrom-lighthousexstix|S| openx
Using authlogic with models that extend the User class (using Single Table Inheritance)
seems to break things since you end up with nil objects for @current_user in your controllers
@@@ ruby class User < ActiveRecord::Base
acts_as_authentic
end class NormalUser < User;end class SpecialUser < User;end @@@
Is it possible to use authlogic with STI?
This ticket has 0 attachment(s).
Comments
binarylogic Fri Aug 07 15:14:29 -0700 2009 | link
Using authlogic with STI User models
I’m not sure, but I dont think it would be difficult to support. What are the specific errors?
by Ben Johnson
binarylogic Fri Aug 07 15:14:32 -0700 2009 | link
Using authlogic with STI User models
I’m using authlogic with STI right now and everything seems to work fine under development, but when I run it in production mode and attempt to update a model, this is what I get:
NoMethodError (undefined method `=’ for #<Patient:0xb34032c>): authlogic (2.1.1) [v] lib/authlogic/acts_as_authentic/password.rb:229:in `send’ authlogic (2.1.1) [v] lib/authlogic/acts_as_authentic/password.rb:229:in `password=’
Here’s the current setup for the models:
class User < ActiveRecord::Base acts_as_authentic end class Patient < User;end class Doctor < User;end
I looked at the password method, but I’m not sure what is happening or what to look for, is authlogic actually passing the whole model to the password method. Any help would be much appreciated.
Thanks! - Vann
by Vann
binarylogic Fri Aug 07 15:14:39 -0700 2009 | link
Using authlogic with STI User models
It looks like:
Patient.crypted_password_field
Is returning nil. What does Patient.column_names return for you?
by Ben Johnson
binarylogic Fri Aug 07 15:14:44 -0700 2009 | link
Using authlogic with STI User models
Here’s what it returns:
>> Patient.column_names
Patient Columns (3.2ms) SHOW FIELDS FROM `users` => ["id", "login", "name", "email", "crypted_password", "salt", "created_at", "updated_at", "remember_token", "remember_token_expires_at", "first_name", "last_name", "ssn", "address", "city", "state", "zip", "drivers_license", "home_phone", "cell_phone", "fax", "employer", "insurance_co", "insurance_type", "insurance_id", "allergies", "medications", "operations", "chronic_conditions", "family_history", "immunizations", "visits_count", "appointments_count", "login_count", "getting_started", "type"]
by Vann
-
The regex in regex.rb for the login field currently is:
/\A\w[\w.+-_@ ]+\z/
This requires the login field to be a minimum of two characters. Shouldn't the first \w be removed or the + be changed to a *? I figure it makes most sense to remove the \w.
Comments
- @Ben Johnson▾
- authlogic▾
- authlogici18n▾
- cookies▾
- documentation▾
- errors▾
- from-lighthouse▾
- http_basic_authentication▾
- i18n▾
- rdoc▾
- session▾
- sti▾
- validation▾
- |S| new▾
- |S| open▾
- Apply to Selection
-
Change Color…
Preview:preview
- Rename…
- Delete



