Initial commit

This commit is contained in:
Maksim Eltyshev
2019-08-31 04:07:25 +05:00
commit 5ffef61fe7
613 changed files with 91659 additions and 0 deletions

21
client/src/sagas/login/index.js Executable file
View File

@@ -0,0 +1,21 @@
import {
all, call, cancel, fork, take,
} from 'redux-saga/effects';
import watchers from './watchers';
import { goToRootService } from './services';
import { setAccessToken } from '../../utils/access-token-storage';
import ActionTypes from '../../constants/ActionTypes';
export default function* () {
const watcherTasks = yield all(watchers.map((watcher) => fork(watcher)));
const {
payload: { accessToken },
} = yield take(ActionTypes.AUTHENTICATE_SUCCEEDED);
yield cancel(watcherTasks);
yield call(setAccessToken, accessToken);
yield call(goToRootService);
}