18 lines
446 B
TypeScript
18 lines
446 B
TypeScript
import { all, put } from "redux-saga/effects";
|
|
import { getSavedAccessGrant } from "../../util/auth";
|
|
import { parseIdToken } from "../actions/auth";
|
|
|
|
export function* initRootSaga() {
|
|
yield all([
|
|
retrieveSessionSaga(),
|
|
]);
|
|
}
|
|
|
|
export function* retrieveSessionSaga() {
|
|
console.log("Checking session status...");
|
|
|
|
const accessGrant = getSavedAccessGrant();
|
|
if (!accessGrant) return;
|
|
|
|
yield put(parseIdToken(accessGrant.id_token));
|
|
} |