+
Sign In
diff --git a/server/.gitignore b/server/.gitignore
new file mode 100644
index 0000000..a629c05
--- /dev/null
+++ b/server/.gitignore
@@ -0,0 +1 @@
+settings.coffee
diff --git a/server/accounts.coffee b/server/accounts.coffee
index be983c6..b3a01ec 100644
--- a/server/accounts.coffee
+++ b/server/accounts.coffee
@@ -12,6 +12,9 @@ Accounts.config {
# Code that checks if a new user request is valid
Accounts.validateNewUser (user) ->
+ if user.services.twitter?
+ user.username = user.services.twitter.screenName
+ return yes
mail = user.emails[0].address
if Match.test(mail,String) is no or validateEmail(mail) is no
throw new Meteor.Error 403, "Invalid Email"
diff --git a/server/server.coffee b/server/server.coffee
index d4cd614..07c2305 100644
--- a/server/server.coffee
+++ b/server/server.coffee
@@ -13,9 +13,11 @@ isUsers = (u,doc) -> u and doc.userId is u
# Returns true if the user has verified at least one email address
userValidated = (user) ->
return no unless user?
+ return yes if user.services.twitter
return yes for mail in user.emails when mail.verified is yes; no
-Meteor.publish 'user', -> Meteor.users.find @userId, fields: dateformat: 1
+Meteor.publish 'user', ->
+ Meteor.users.find @userId, fields: {dateformat: 1, username: 1}
# Publish user's notes to each user.
Meteor.publish "my-notes", ->
if userValidated getUser(@userId)
@@ -26,6 +28,8 @@ Meteor.publish "archive", ->
# Custom new account default settings
Accounts.onCreateUser (options, user) ->
+ console.log options
+ console.log user
user.dateformat = options.dateformat or "MM/DD/YYYY"
return user