force user initialisation - fixes #2
This commit is contained in:
@@ -13,7 +13,7 @@ export class UtilService {
|
|||||||
return String(error)
|
return String(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static circleSafeStringify(obj: any) {
|
public static stringifySafely(obj: any) {
|
||||||
let cache: any[] = [];
|
let cache: any[] = [];
|
||||||
let str = JSON.stringify(obj, function(key, value) {
|
let str = JSON.stringify(obj, function(key, value) {
|
||||||
if (typeof value === "object" && value !== null) {
|
if (typeof value === "object" && value !== null) {
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
const config = useRuntimeConfig();
|
const config = useRuntimeConfig();
|
||||||
const newAccountName = ref("");
|
const newAccountName = ref("");
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await authStore.initUser();
|
||||||
|
});
|
||||||
|
|
||||||
watchEffect(async () => {
|
watchEffect(async () => {
|
||||||
if (activeMembership.value) {
|
if (activeMembership.value) {
|
||||||
await accountStore.getActiveAccountMembers();
|
await accountStore.getActiveAccountMembers();
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
const notesStore = useNotesStore();
|
const notesStore = useNotesStore();
|
||||||
const { notes } = storeToRefs(notesStore); // ensure the notes list is reactive
|
const { notes } = storeToRefs(notesStore); // ensure the notes list is reactive
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await authStore.initUser();
|
||||||
|
});
|
||||||
|
|
||||||
watchEffect(async () => {
|
watchEffect(async () => {
|
||||||
if (activeMembership.value) {
|
if (activeMembership.value) {
|
||||||
await notesStore.fetchNotesForCurrentUser();
|
await notesStore.fetchNotesForCurrentUser();
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const { activeMembership } = storeToRefs(authStore);
|
const { activeMembership } = storeToRefs(authStore);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await authStore.initUser();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ export async function createContext(event: H3Event){
|
|||||||
|
|
||||||
if(!user || !dbUser) {
|
if(!user || !dbUser) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: 'INTERNAL_SERVER_ERROR',
|
code: 'UNAUTHORIZED',
|
||||||
message: `Unable to fetch user data, please try again later. Missing ->[user:${(!user)},dbUser:${(!dbUser)}]`,
|
message: `Unable to fetch user data at this time. Missing ->[user:${(!user)},dbUser:${(!dbUser)}]`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user