mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
13 lines
514 B
TypeScript
13 lines
514 B
TypeScript
|
import { Dispatch } from "redux";
|
||
|
import AutheliaService from "../services/AutheliaService";
|
||
|
import { getAvailbleMethods, getAvailbleMethodsSuccess, getAvailbleMethodsFailure } from "../reducers/Portal/SecondFactor/actions";
|
||
|
|
||
|
export default async function(dispatch: Dispatch) {
|
||
|
dispatch(getAvailbleMethods());
|
||
|
try {
|
||
|
const methods = await AutheliaService.getAvailable2faMethods();
|
||
|
dispatch(getAvailbleMethodsSuccess(methods));
|
||
|
} catch (err) {
|
||
|
dispatch(getAvailbleMethodsFailure(err.message))
|
||
|
}
|
||
|
}
|