From b9ab799569e584cf6a297430791d4562cfa1b2bb Mon Sep 17 00:00:00 2001
From: maxwell <maxwell@joindiaspora.com>
Date: Sat, 4 Dec 2010 16:49:45 -0800
Subject: [PATCH] ironing out invites

---
 app/controllers/invitations_controller.rb | 1 -
 app/models/user.rb                        | 4 +++-
 app/views/invitations/edit.html.haml      | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb
index caff1cb0b9..03567166e6 100644
--- a/app/controllers/invitations_controller.rb
+++ b/app/controllers/invitations_controller.rb
@@ -37,7 +37,6 @@ class InvitationsController < Devise::InvitationsController
         raise "Invalid Invite Token"
       end
       user = User.find_by_invitation_token(params[:user][:invitation_token])
-      puts user.inspect
       user.seed_aspects
       user.accept_invitation!(params[:user])
     rescue Exception => e
diff --git a/app/models/user.rb b/app/models/user.rb
index 51d8f2b265..8d7969805c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -381,7 +381,7 @@ class User
       log_string << "inviter=#{invitations_to_me.first.from.diaspora_handle}" if invitations_to_me.first
       Rails.logger.info log_string
       self.setup(opts)
-
+      puts "foobar"
       self.invitation_token = nil
       self.password              = opts[:password]
       self.password_confirmation = opts[:password_confirmation]
@@ -419,6 +419,8 @@ class User
 
     self.serialized_private_key ||= User.generate_key
     self.person.serialized_public_key = OpenSSL::PKey::RSA.new(self.serialized_private_key).public_key
+    
+    puts self.serialized_public_key
     self
   end
 
diff --git a/app/views/invitations/edit.html.haml b/app/views/invitations/edit.html.haml
index 30c04e0d04..365f8af391 100644
--- a/app/views/invitations/edit.html.haml
+++ b/app/views/invitations/edit.html.haml
@@ -19,6 +19,7 @@
       %p
         = f.label :password_confirmation , t('password_confirmation')
         = f.password_field :password_confirmation, :title => t('registrations.new.enter_password_again') 
+        = f.hidden_field :invitation_token
 
       = f.submit t('registrations.new.sign_up')
       %br
-- 
GitLab