Created
February 12, 2009 04:15
-
-
Save edavis10/62482 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/user.rb b/app/models/user.rb | |
index b35c1a8..4f8223d 100644 | |
--- a/app/models/user.rb | |
+++ b/app/models/user.rb | |
@@ -80,6 +80,15 @@ class User < ActiveRecord::Base | |
super | |
end | |
+ def identity_url=(url) | |
+ begin | |
+ self.write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url)) | |
+ rescue InvalidOpenId | |
+ # Invlaid url, don't save | |
+ end | |
+ self.read_attribute(:identity_url) | |
+ end | |
+ | |
# Returns the user that matches provided login and password, or nil | |
def self.try_to_login(login, password) | |
# Make sure no one can sign in with an empty password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment