Skip to content

Instantly share code, notes, and snippets.

View fedesoria's full-sized avatar

Federico Soria fedesoria

View GitHub Profile
def owns?(user)
# Am I duplicating this? Does this exist somewhere? (paco)
# Where do you use it? (chubas)
# Are you free this weekend? (paco)
logged_in? && user == current_user
end
def create
logout_keeping_session!
if using_open_id?
authenticate_with_open_id(params[:openid_url], :return_to => open_id_create_url,
:required => [:nickname, :email]) do |result, identity_url, registration|
if result.successful?
create_new_user(:identity_url => identity_url, :login => registration['nickname'], :email => registration['email'])
else
failed_creation(result.message || "Sorry, something went wrong")
end