Skip to content

Commit

Permalink
show warning if SA key nor emulator host missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscorn committed Sep 28, 2024
1 parent bf4d844 commit 943d3af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mierune/sveltekit-firebase-auth-ssr",
"version": "0.0.15",
"version": "0.0.16",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
Expand Down
4 changes: 4 additions & 0 deletions src/lib/firebase-auth/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export function createAuthHandle({
keyStore: keyStoreMaker
}: AuthHandleOptions): Handle {
return async ({ event, resolve }) => {
if (!serviceAccountCredential && !emulatorEnv.FIREBASE_AUTH_EMULATOR_HOST) {
console.error('FIREBASE_SERVICE_ACCOUNT_KEY is not set. Authentication will not work.');
}

const auth = getAuth(projectId, keyStoreMaker(event.platform), serviceAccountCredential);
const { request, cookies, fetch } = event;

Expand Down

0 comments on commit 943d3af

Please sign in to comment.