-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethods.coffee
More file actions
25 lines (24 loc) · 799 Bytes
/
methods.coffee
File metadata and controls
25 lines (24 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Meteor.methods
checkIdentity: (email) ->
check email, String
if Meteor.isServer
user = Meteor.users.findOne { 'emails.address': email }
if user?
return user
else
return false
false
completeVerify: (token) ->
check token, String
if Meteor.isServer
u = Meteor.user()
if not u?
u = Meteor.users.findOne {
'services.email.verificationTokens.token': token
}
vTokens = u?.services?.email?.verificationTokens
if vTokens?
currentToken = _.findWhere vTokens, { token: token }
if currentToken?
return currentToken.address
false