mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: add login event actions
This commit is contained in:
@@ -33,12 +33,17 @@ export const useLogin = (
|
||||
>,
|
||||
) => {
|
||||
const { apiClient } = useApiClient();
|
||||
const { postMessage } = useBroadcastChannel();
|
||||
|
||||
return useMutation({
|
||||
...options,
|
||||
async mutationFn(credentials) {
|
||||
return await apiClient.login(credentials);
|
||||
},
|
||||
onSuccess: (data, variables, context) => {
|
||||
options?.onSuccess?.(data, variables, context);
|
||||
postMessage({ event: "login" });
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user