Skip to content

Commit 146b94d

Browse files
committed
Added missing type defs
1 parent b3abeb8 commit 146b94d

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

packages/client/src/AccountsClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export class AccountsClient {
291291
const Accounts = {
292292
instance: AccountsClient,
293293
ui: {},
294-
config(options: Object, transport: TransportInterface) {
294+
config(options: AccountsClientConfiguration, transport: TransportInterface) {
295295
this.instance = new AccountsClient({
296296
...config,
297297
...options,
@@ -300,7 +300,7 @@ const Accounts = {
300300
user(): UserObjectType | null {
301301
return this.instance.user();
302302
},
303-
options(): Object {
303+
options(): AccountsClientConfiguration {
304304
return this.instance.options;
305305
},
306306
createUser(user: CreateUserType, callback: ?Function): Promise<void> {

packages/client/src/config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export type AccountsClientConfiguration = AccountsCommonConfiguration & {
3636
onVerifyEmailHook?: Function,
3737
onSignedInHook?: Function,
3838
onSignedOutHook?: Function,
39-
loginOnSignUp?: boolean
39+
loginOnSignUp?: boolean,
40+
history?: Object
4041
};
4142

4243
export default {
@@ -63,10 +64,10 @@ export default {
6364
// onSubmitHook: () => {},
6465
// onPreSignUpHook: () => new Promise(resolve => resolve()),
6566
// onPostSignUpHook: () => {},
66-
onEnrollAccountHook: () => redirect(AccountsClient.options().loginPath),
67-
onResetPasswordHook: () => redirect(AccountsClient.options().loginPath),
68-
onVerifyEmailHook: () => redirect(AccountsClient.options().profilePath),
69-
onSignedInHook: () => redirect(AccountsClient.options().homePath),
70-
onSignedOutHook: () => redirect(AccountsClient.options().signOutPath),
67+
onEnrollAccountHook: () => redirect(AccountsClient.options().loginPath || '/'),
68+
onResetPasswordHook: () => redirect(AccountsClient.options().loginPath || '/'),
69+
onVerifyEmailHook: () => redirect(AccountsClient.options().profilePath || '/'),
70+
onSignedInHook: () => redirect(AccountsClient.options().homePath || '/'),
71+
onSignedOutHook: () => redirect(AccountsClient.options().signOutPath || '/'),
7172
loginOnSignUp: true,
7273
};

packages/client/src/redirect.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
// eslint-disable-next-line import/no-named-as-default
33
import AccountsClient from './AccountsClient';
44

5+
// $FlowFixMe
56
export default (path: string) => AccountsClient.options().history.push(path);

0 commit comments

Comments
 (0)