diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 0af163e..0000000 --- a/.dockerignore +++ /dev/null @@ -1,18 +0,0 @@ -node_modules -Dockerfile* -docker-compose* -.dockerignore -.git -.gitignore -README.md -LICENSE -.vscode -Makefile -helm-charts -.editorconfig -.idea -coverage* -.svelte-kit -.storybook -tbm-m2-dev-90d717d5e58a.json -env* \ No newline at end of file diff --git a/.gitignore b/.gitignore index ed7466d..4225035 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,3 @@ vite.config.ts.timestamp-* *storybook.log storybook-static - -tbm-m2-dev-90d717d5e58a.json -env* - diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 090c2ae..0000000 --- a/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Stage 1: Build -FROM oven/bun:latest AS builder -WORKDIR /app -COPY . . -RUN bun install --frozen-lockfile -RUN bun run build - -# Stage 2: Production Runtime -FROM oven/bun:latest -WORKDIR /app -# Copy only necessary files from the builder -COPY --from=builder /app/build ./build -COPY --from=builder /app/package.json . - -ENV PORT=3167 -EXPOSE 3167 -USER bun -# Run the application from the build directory -CMD ["bun", "build/index.js"] \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 2cfb9c4..8f834d4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 51474d7..21a2ea8 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "@storybook/addon-vitest": "^10.2.0", "@storybook/sveltekit": "^10.2.0", "@sveltejs/adapter-auto": "^7.0.0", - "@sveltejs/adapter-node": "^5.5.4", "@sveltejs/kit": "^2.50.1", "@sveltejs/vite-plugin-svelte": "^6.2.4", "@tailwindcss/forms": "^0.5.11", @@ -45,7 +44,6 @@ "prettier-plugin-tailwindcss": "^0.7.2", "storybook": "^10.2.0", "svelte": "^5.48.0", - "svelte-adapter-bun": "^1.0.1", "svelte-check": "^4.3.5", "svelte-sonner": "^1.0.7", "tailwind-merge": "^3.4.0", diff --git a/src/lib/components/app-account-select.svelte b/src/lib/components/app-account-select.svelte index 9079395..a756528 100644 --- a/src/lib/components/app-account-select.svelte +++ b/src/lib/components/app-account-select.svelte @@ -103,7 +103,7 @@ {/each} --> - +
diff --git a/src/lib/core/auth/domainBlocker.ts b/src/lib/core/auth/domainBlocker.ts index 3558bdc..fa55018 100644 --- a/src/lib/core/auth/domainBlocker.ts +++ b/src/lib/core/auth/domainBlocker.ts @@ -1,15 +1,17 @@ -import { doc, getDoc } from 'firebase/firestore'; -import { db } from '../client/firebase'; +import { doc, getDoc } from "firebase/firestore"; +import { db } from "../client/firebase"; + export async function checkAllowAccess(userDomain: string): Promise { - const docRef = doc(db, 'whitelist', 'allowedDomains'); - const snapshot = await getDoc(docRef); - if (snapshot.exists()) { - let domains = snapshot.data(); - // console.log(`domains: ${JSON.stringify(domains)}`); - return domains['account_email'].includes(userDomain); - } + const docRef = doc(db, "whitelist", "allowedDomains"); + const snapshot = await getDoc(docRef); - return true; -} + if(snapshot.exists()){ + let domains = snapshot.data(); + // console.log(`domains: ${JSON.stringify(domains)}`); + return domains["account_email"].includes(userDomain); + } + + return false; +}; \ No newline at end of file diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index a6a0cda..7024a53 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -3,9 +3,6 @@ import { page } from '$app/state'; import { env } from '$env/dynamic/public'; - import { browser } from '$app/environment'; - import { setCookieOnNonBrowser } from '$lib/helpers/cookie'; - import { asset } from '$app/paths'; import TaobinLogo from '$lib/assets/logo.svelte'; import { @@ -62,11 +59,6 @@ // console.log('login success!'); - if (browser && 'cookieStore' in window) await cookieStore.set('logged_in', 'true'); - else { - setCookieOnNonBrowser('logged_in', 'true'); - } - goto('/entry'); } } catch (error: any) { diff --git a/svelte.config.js b/svelte.config.js index b084c6f..f18dfab 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-node'; +import adapter from '@sveltejs/adapter-auto'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */