Skip to content

Commit

Permalink
Merge pull request #600 from yeatmanlab/enh/restConfig-change
Browse files Browse the repository at this point in the history
Force Token Refresh on SSO Logins
  • Loading branch information
richford authored May 22, 2024
2 parents c1d6406 + fc88ac6 commit ad86c67
Show file tree
Hide file tree
Showing 31 changed files with 1,792 additions and 70 deletions.
1,746 changes: 1,733 additions & 13 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@bdelab/roam-fluency": "^1.11.19",
"@bdelab/roar-firekit": "^4.11.0",
"@bdelab/roar-firekit": "^5.0.0",
"@bdelab/roar-letter": "^1.11.4",
"@bdelab/roar-multichoice": "^1.11.3",
"@bdelab/roar-pa": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreateAdministration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ const init = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(async () => {
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
});
watch([preExistingAdminInfo, allVariants], ([adminInfo, allVariantInfo]) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreateAdministrator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ const init = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(() => {
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
});
const selectedOrgs = ref();
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreateOrgs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ const initTable = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) initTable();
if (state.roarfirekit.restConfig()) initTable();
});
onMounted(() => {
if (roarfirekit.value.restConfig) initTable();
if (roarfirekit.value.restConfig()) initTable();
});
const { isLoading: isLoadingClaims, data: userClaims } = useQuery({
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListOrgs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ const initTable = () => {
const { roarfirekit } = storeToRefs(authStore);
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) initTable();
if (state.roarfirekit.restConfig()) initTable();
});
onMounted(() => {
if (roarfirekit.value.restConfig) initTable();
if (roarfirekit.value.restConfig()) initTable();
});
watch(allDistricts, (newValue) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ListUsers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ const init = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(() => {
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
});
</script>
4 changes: 2 additions & 2 deletions src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ const init = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(() => {
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
window.addEventListener('resize', handleResize);
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/OrgPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ const init = () => {
const { roarfirekit } = storeToRefs(authStore);
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(() => {
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
});
watch(allDistricts, (newValue) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/reports/SubscoreTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ const refresh = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) refresh();
if (state.roarfirekit.restConfig()) refresh();
});
onMounted(async () => {
if (roarfirekit.value.restConfig) refresh();
if (roarfirekit.value.restConfig()) refresh();
});
</script>
<style>
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/RegisterTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ const init = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(() => {
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
});
const { isFetching: isFetchingTasks, data: tasks } = useQuery({
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskCrowding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskFluency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskLetter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskLevante.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -71,7 +71,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskMultichoice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskPA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskRan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskSRE.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskSWR.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/tasks/TaskVocab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const handlePopState = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -70,7 +70,7 @@ onMounted(async () => {
console.error('An error occurred while importing the game module.', error);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (isFirekitInit.value && !isLoadingUserData.value) {
await startTask();
}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/query/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const getProjectId = (project = 'admin') => {
export const getAxiosInstance = (db = 'admin') => {
const authStore = useAuthStore();
const { roarfirekit } = storeToRefs(authStore);
const axiosOptions = _get(roarfirekit.value.restConfig, db) ?? {};
const axiosOptions = _get(roarfirekit.value.restConfig(), db) ?? {};
return axios.create(axiosOptions);
};

Expand Down
3 changes: 1 addition & 2 deletions src/pages/CleverLanding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const router = useRouter();
const authStore = useAuthStore();
let userDataCheckInterval;
async function checkForUserType() {
try {
const userData = await fetchDocById('users', authStore.uid);
Expand All @@ -31,7 +30,7 @@ async function checkForUserType() {
}
}
userDataCheckInterval = setInterval(checkForUserType, 500);
userDataCheckInterval = setInterval(checkForUserType, 1000);
</script>
<style>
.loading-container {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/HomeAdministrator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ const init = () => {
};
unsubscribeInitializer = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(() => {
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
});
const isSuperAdmin = computed(() => Boolean(userClaims.value?.claims?.super_admin));
Expand Down
4 changes: 2 additions & 2 deletions src/pages/HomeParticipant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ const authStore = useAuthStore();
const { roarfirekit, consentSpinner } = storeToRefs(authStore);
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
onMounted(async () => {
GameTabs = (await import('../components/GameTabs.vue')).default;
ParticipantSidebar = (await import('../components/ParticipantSidebar.vue')).default;
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
});
const gameStore = useGameStore();
Expand Down
4 changes: 2 additions & 2 deletions src/pages/HomeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const init = () => {
};
unsubscribe = authStore.$subscribe(async (mutation, state) => {
if (state.roarfirekit.restConfig) init();
if (state.roarfirekit.restConfig()) init();
});
const { isLoading: isLoadingUserData, data: userData } = useQuery({
Expand Down Expand Up @@ -127,7 +127,7 @@ onMounted(async () => {
requireRefresh.value = false;
router.go(0);
}
if (roarfirekit.value.restConfig) init();
if (roarfirekit.value.restConfig()) init();
if (!isLoading.value) {
refreshDocs();
await checkConsent();
Expand Down
Loading

0 comments on commit ad86c67

Please sign in to comment.