From 971d220483684d747eda56b6d6102820b0185819 Mon Sep 17 00:00:00 2001 From: bolyachevets Date: Sun, 21 Jan 2024 01:38:11 -0800 Subject: [PATCH 1/5] firebase auth --- .gitignore | 1 + app.vue | 7 +++ components/StatusBox.vue | 18 ++++++-- components/app_header/Container.vue | 69 ++++++++++++++++++++-------- components/search/ResultsBox.vue | 64 +++++++++++++++----------- components/search/ResultsControl.vue | 17 ++++--- nuxt.config.ts | 5 +- package-lock.json | 41 +++++++++++------ package.json | 3 +- pages/Search.vue | 17 ++++++- pages/index.vue | 39 ++++++++++++---- plugins/firebase.client.ts | 8 ++++ plugins/keycloak.client.ts | 28 ----------- pnpm-lock.yaml | 10 ---- store/user-cache.ts | 33 +++++++++++++ util/firebase-auth.ts | 38 +++++++++++++++ util/namex-api.ts | 34 +++++++------- 17 files changed, 291 insertions(+), 141 deletions(-) delete mode 100644 plugins/keycloak.client.ts create mode 100644 store/user-cache.ts create mode 100644 util/firebase-auth.ts diff --git a/.gitignore b/.gitignore index b66a020e..163580ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/app.vue b/app.vue index f8eacfa7..7ee30c27 100644 --- a/app.vue +++ b/app.vue @@ -3,3 +3,10 @@ + diff --git a/components/StatusBox.vue b/components/StatusBox.vue index b78c57e9..6d08c8bb 100644 --- a/components/StatusBox.vue +++ b/components/StatusBox.vue @@ -6,12 +6,16 @@
Not Examined: - {{ - status.notExaminedNum - }} + {{ notExaminedNum }}
- Hold: {{ status.holdNum }} + Hold: {{ holdNum }}
@@ -20,6 +24,10 @@ import { useStatusStore } from '~/store/status' const status = useStatusStore() +status.update() -onMounted(async () => await status.update()) +const notExaminedNum = computed(() => status.notExaminedNum) +const holdNum = computed(() => status.holdNum) + +// onMounted(async () => await status.update()) diff --git a/components/app_header/Container.vue b/components/app_header/Container.vue index d3d00318..ae70dcd8 100644 --- a/components/app_header/Container.vue +++ b/components/app_header/Container.vue @@ -7,49 +7,79 @@ src="/images/top-nav.png" class="min-w-8 h-full" alt="Name Examination" - /> + > -
- - - +
+ + +
-
+
- + Stats
- {{ $userProfile.username }} - + {{ userName }} + Log Out
-
- - +
+ + Login
@@ -60,11 +90,14 @@ diff --git a/components/search/ResultsBox.vue b/components/search/ResultsBox.vue index 464eaa2a..2282128c 100644 --- a/components/search/ResultsBox.vue +++ b/components/search/ResultsBox.vue @@ -1,5 +1,7 @@