diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-04-20 16:51:57 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-04-20 16:51:57 +0300 |
commit | 02819ca16969b103493ebdd9a66f058995421507 (patch) | |
tree | a3352b65083c79ab733db2b99e7c4f0a1276277e /packages/meteor-useraccounts-core/lib/utils.js | |
parent | 53d42a17ffbc6466d2d422dfdcbd867ea31fe082 (diff) | |
parent | a5122cc0764b57a163c3e8ca3e00e703669a98db (diff) | |
download | wekan-02819ca16969b103493ebdd9a66f058995421507.tar.gz wekan-02819ca16969b103493ebdd9a66f058995421507.tar.bz2 wekan-02819ca16969b103493ebdd9a66f058995421507.zip |
Merge branch 'edge' into meteor-1.8
Diffstat (limited to 'packages/meteor-useraccounts-core/lib/utils.js')
-rw-r--r-- | packages/meteor-useraccounts-core/lib/utils.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/meteor-useraccounts-core/lib/utils.js b/packages/meteor-useraccounts-core/lib/utils.js new file mode 100644 index 00000000..30b108ca --- /dev/null +++ b/packages/meteor-useraccounts-core/lib/utils.js @@ -0,0 +1,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"; + } + } +}; |