2019-12-08 00:32:00 +05:30
|
|
|
import * as actions from 'app/components/auth/actions';
|
2019-12-26 17:48:58 +05:30
|
|
|
import { updateUser } from 'app/components/user/actions';
|
|
|
|
import {
|
2020-05-24 04:38:24 +05:30
|
|
|
authenticate,
|
|
|
|
logoutAll as logout,
|
|
|
|
remove as removeAccount,
|
|
|
|
activate as activateAccount,
|
2019-12-26 17:48:58 +05:30
|
|
|
} from 'app/components/accounts/actions';
|
|
|
|
|
|
|
|
import AuthFlow, { ActionsDict, AuthContext as TAuthContext } from './AuthFlow';
|
2016-03-02 02:06:14 +05:30
|
|
|
|
2020-01-18 02:07:52 +05:30
|
|
|
const availableActions: ActionsDict = {
|
2020-05-24 04:38:24 +05:30
|
|
|
updateUser,
|
|
|
|
authenticate,
|
|
|
|
activateAccount,
|
|
|
|
removeAccount,
|
|
|
|
logout,
|
|
|
|
goBack: actions.goBack,
|
|
|
|
redirect: actions.redirect,
|
|
|
|
login: actions.login,
|
|
|
|
acceptRules: actions.acceptRules,
|
|
|
|
forgotPassword: actions.forgotPassword,
|
|
|
|
recoverPassword: actions.recoverPassword,
|
|
|
|
register: actions.register,
|
|
|
|
activate: actions.activate,
|
|
|
|
resendActivation: actions.resendActivation,
|
|
|
|
contactUs: actions.contactUs,
|
|
|
|
setLogin: actions.setLogin,
|
|
|
|
setAccountSwitcher: actions.setAccountSwitcher,
|
|
|
|
setErrors: actions.setErrors,
|
|
|
|
clearErrors: actions.clearErrors,
|
|
|
|
oAuthValidate: actions.oAuthValidate,
|
|
|
|
oAuthComplete: actions.oAuthComplete,
|
|
|
|
setClient: actions.setClient,
|
|
|
|
resetOAuth: actions.resetOAuth,
|
|
|
|
resetAuth: actions.resetAuth,
|
|
|
|
setOAuthRequest: actions.setOAuthRequest,
|
|
|
|
setOAuthCode: actions.setOAuthCode,
|
|
|
|
requirePermissionsAccept: actions.requirePermissionsAccept,
|
|
|
|
setScopes: actions.setScopes,
|
|
|
|
setLoadingState: actions.setLoadingState,
|
2016-04-12 09:19:58 +05:30
|
|
|
};
|
|
|
|
|
2019-12-25 15:31:12 +05:30
|
|
|
export type AuthContext = TAuthContext;
|
2020-01-18 02:07:52 +05:30
|
|
|
export default new AuthFlow(availableActions);
|