Closed AO19 closed 3 years ago
Is there a disadvantage of setting AuthProviderConfig like this:
export interface AuthProviderConfig<User = unknown, Error = unknown> { key?: string; loadUser: (data: any) => Promise<User>; loginFn: (data: any) => Promise<User>; registerFn: (data: any) => Promise<User>; logoutFn: (data?: any) => Promise<any>; waitInitial?: boolean; LoaderComponent?: () => JSX.Element; ErrorComponent?: ({ error }: { error: Error | null; }) => JSX.Element; }
Otherwise I was not able to set the logoutFn with a parameter.
Original:
export interface AuthProviderConfig<User = unknown, Error = unknown> { key?: string; loadUser: (data: any) => Promise<User>; loginFn: (data: any) => Promise<User>; registerFn: (data: any) => Promise<User>; logoutFn: () => Promise<any>; waitInitial?: boolean; LoaderComponent?: () => JSX.Element; ErrorComponent?: ({ error }: { error: Error | null; }) => JSX.Element; }
@alan2207 what are your thoughts on this? Should I open a pull request or is there something incorrect with this proposal?
Hey @AO19, a PR is a good idea. If someone has its use case to provide something to the logout function, let's allow it. So please open a PR for this and I will merge it.
Thanks!
Is there a disadvantage of setting AuthProviderConfig like this:
Otherwise I was not able to set the logoutFn with a parameter.
Original:
@alan2207 what are your thoughts on this? Should I open a pull request or is there something incorrect with this proposal?