From 088236c94ee66b50268a3f5af06c69d598e3f42f Mon Sep 17 00:00:00 2001 From: muerwre Date: Mon, 10 Dec 2018 14:55:33 +0700 Subject: [PATCH] auth: moved them to auth --- src/redux/user/sagas.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/redux/user/sagas.js b/src/redux/user/sagas.js index ad953ad..9befdd6 100644 --- a/src/redux/user/sagas.js +++ b/src/redux/user/sagas.js @@ -108,11 +108,6 @@ function* iframeLoginVkSaga({ viewer_id, access_token, auth_key }) { function* mapInitSaga() { const { hash } = getUrlData(); - if (window.location.search) { - const { viewer_id, access_token, auth_key } = yield parseQuery(window.location.search); - if (viewer_id && access_token && auth_key) yield put(iframeLoginVk({ viewer_id, access_token, auth_key })); - } - if (hash && /^#map/.test(hash)) { const [, newUrl] = hash.match(/^#map[:/?!](.*)$/); @@ -149,6 +144,11 @@ function* mapInitSaga() { function* authCheckSaga() { const { id, token } = yield select(getUser); + if (window.location.search) { + const { viewer_id, access_token, auth_key } = yield parseQuery(window.location.search); + if (viewer_id && access_token && auth_key) yield put(iframeLoginVk({ viewer_id, access_token, auth_key })); + } + if (id && token) { const user = yield call(checkUserToken, { id, token });