This repository has been archived by the owner on Oct 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
meteor_accounts-base_vx.x.x.js
116 lines (113 loc) · 2.99 KB
/
meteor_accounts-base_vx.x.x.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
declare type Meteor$Accounts$SuccessfulLoginAttempt = {|
allowed: true,
connection: Meteor$ConnectionHandle,
methodArguments: mixed[],
methodName: string,
type: string,
user: Meteor$User
|};
declare type Meteor$Accounts$FailedLoginAttempt = {|
allowed: false,
connection: Meteor$ConnectionHandle,
error: Meteor$Error | Error,
methodArguments: mixed[],
methodName: string,
type: string,
user?: Meteor$User
|};
declare class Meteor$Accounts {
_storedLoginToken(): string;
_storedLoginTokenExpires(): string;
_storedUserId(): string;
callLoginMethod(options: {
methodName?: string,
methodArguments?: mixed[],
userCallback: (?Meteor$Error) => void
}): void;
config(options: {
ambiguousErrorMessages?: boolean,
forbidClientAccountCreation?: boolean,
loginExpirationInDays?: number,
oauthSecretKey?: string,
passwordEnrollTokenExpirationInDays?: number,
passwordResetTokenExpirationInDays?: number,
restrictCreationByEmailDomain?: string | (string => ?boolean),
sendVerificationEmail?: boolean
}): void;
findUserByEmail(email: string): null | Meteor$User;
forgotPassword(options: {email: string}, fn?: (?Error) => void): void;
loggingIn(): boolean;
loginServicesConfigured(): boolean;
logout(fn?: (?Error) => void): void;
logoutOtherClients(fn?: (?Error) => void): void;
onCreateUser(
fn: (options: Meteor$User, user: Meteor$User) => Meteor$User
): void;
onEmailVerificationLink(fn: (token: string, done: () => void) => void): void;
onLogin(fn: (Meteor$Accounts$SuccessfulLoginAttempt) => void): {stop(): void};
onLoginFailure(
fn: (Meteor$Accounts$FailedLoginAttempt) => void
): {stop(): void};
onLogout(
fn: (user: Meteor$User, connection: Meteor$ConnectionHandle) => void
): void;
removeDefaultRateLimit: () => void;
resetPassword(
token: string,
password: string,
fn?: (?Meteor$Error) => void
): void;
registerLoginHandler(
name: string,
fn: (options: {[string]: mixed}) => ?{userId: string}
): void;
sendEnrollmentEmail(
userId: string,
email?: string,
extraTokenData?: {}
): {
email: string,
user: Meteor$User,
token: string,
url: string,
options: {}
};
sendResetPasswordEmail(
userId: string,
email?: string,
extraTokenData?: {}
): {
email: string,
user: Meteor$User,
token: string,
url: string,
options: {}
};
sendVerificationEmail(
userId: string,
email?: string,
extraTokenData?: {}
): {
email: string,
user: Meteor$User,
token: string,
url: string,
options: {}
};
urls: {
enrollAccount: (token: string) => string,
resetPassword: (token: string) => string,
verifyEmail: (token: string) => string
};
validateLoginAttempt(
fn: (
| Meteor$Accounts$SuccessfulLoginAttempt
| Meteor$Accounts$FailedLoginAttempt
) => boolean
): {stop(): void};
}
declare module 'meteor/accounts-base' {
declare module.exports: {
Accounts: Meteor$Accounts
};
}