+ def openid_email_verified(openid_url, email)
+ # OpenID providers Google and Yahoo are guaranteed to return (if at all) an email address that has been verified by
+ # them already. So we can trust the email addresses to be valid and own by the user without having to verify them our
+ # selves.
+ # Store the email in the session to compare agains the user set email address during account creation.
+ openid_verified = Hash.new
+ openid_verified[:identity_url] = openid_url
+ if openid_url.match(/https:\/\/www.google.com\/accounts\/o8\/id?(.*)/) or openid_url.match(/https:\/\/me.yahoo.com\/(.*)/)
+ openid_verified[:email] = email
+ end
+ return openid_verified
+
+ end
+