Skip to content

Instantly share code, notes, and snippets.

@whisher
Last active June 14, 2020 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whisher/3eeb0eb76401f32dd032f3c55654e39f to your computer and use it in GitHub Desktop.
Save whisher/3eeb0eb76401f32dd032f3c55654e39f to your computer and use it in GitHub Desktop.
export const authLoginEffects = (data: AuthLoginFormData) => (
dispatch: ThunkDispatch<{}, {}, AnyAction>
) => {
AuthService.login(data)
.then((data) => {
dispatch(authLoginSuccess(data));
Storage.local.set("auth", data);
dispatch(push("/user"));
})
.catch((_) => {
dispatch(authLoginFailure());
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment