mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
auth: api call?
This commit is contained in:
parent
088236c94e
commit
a43bac4c26
3 changed files with 21 additions and 2 deletions
|
@ -1,7 +1,15 @@
|
|||
import { REHYDRATE } from 'redux-persist';
|
||||
import { delay } from 'redux-saga';
|
||||
import { takeLatest, select, call, put, takeEvery, race, take } from 'redux-saga/effects';
|
||||
import { checkUserToken, getGuestToken, getStoredMap, getVkIframeUser, getVkUserInfo, postMap } from '$utils/api';
|
||||
import {
|
||||
checkIframeToken,
|
||||
checkUserToken,
|
||||
getGuestToken,
|
||||
getStoredMap,
|
||||
getVkIframeUser,
|
||||
getVkUserInfo,
|
||||
postMap
|
||||
} from '$utils/api';
|
||||
import {
|
||||
hideRenderer, iframeLoginVk,
|
||||
setActiveSticker, setAddress,
|
||||
|
@ -146,7 +154,14 @@ function* authCheckSaga() {
|
|||
|
||||
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 (viewer_id && access_token && auth_key) {
|
||||
const user = yield call(checkIframeToken, { viewer_id, access_token, auth_key });
|
||||
|
||||
if (user) {
|
||||
yield put(setUser(user));
|
||||
return yield call(mapInitSaga);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (id && token) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue