summaryrefslogtreecommitdiffstats
path: root/packages/meteor-useraccounts-core/lib/utils.js
blob: 30b108cad0d6b1912be85d0d0b6f3a24ce129d97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
capitalize = function(str) {
  return str.charAt(0).toUpperCase() + str.slice(1);
};

signedInAs =  function() {
  var user = Meteor.user();

  if (user) {
    if (user.username) {
      return user.username;
    } else if (user.profile && user.profile.name) {
      return user.profile.name;
    } else if (user.emails && user.emails[0]) {
      return user.emails[0].address;
    } else {
      return "Signed In";
    }
  }
};