From 605161df8abad978721bdbb2767168ed8353f8e3 Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Mon, 8 May 2017 20:53:48 +0100 Subject: [PATCH] [with-firebase] Ensure server credentials aren't bundled with client code (#1875) * [with-firebase] Ensure server credentials aren't bundled with client code * [with-firebase] Fix travis build failure --- examples/with-firebase/credentials/client.js | 3 +++ examples/with-firebase/credentials/server.js | 3 +++ examples/with-firebase/firebaseCredentials.js | 8 -------- examples/with-firebase/pages/index.js | 2 +- examples/with-firebase/server.js | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 examples/with-firebase/credentials/client.js create mode 100644 examples/with-firebase/credentials/server.js delete mode 100644 examples/with-firebase/firebaseCredentials.js diff --git a/examples/with-firebase/credentials/client.js b/examples/with-firebase/credentials/client.js new file mode 100644 index 00000000..a9482b25 --- /dev/null +++ b/examples/with-firebase/credentials/client.js @@ -0,0 +1,3 @@ +module.exports = { + // TODO firebase client config +} diff --git a/examples/with-firebase/credentials/server.js b/examples/with-firebase/credentials/server.js new file mode 100644 index 00000000..aa1ebc6d --- /dev/null +++ b/examples/with-firebase/credentials/server.js @@ -0,0 +1,3 @@ +module.exports = { + // TODO firebase server config +} diff --git a/examples/with-firebase/firebaseCredentials.js b/examples/with-firebase/firebaseCredentials.js deleted file mode 100644 index 884933a7..00000000 --- a/examples/with-firebase/firebaseCredentials.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - clientCredentials: { - // TODO firebase client config - }, - serverCredentials: { - // TODO service account json here - } -} diff --git a/examples/with-firebase/pages/index.js b/examples/with-firebase/pages/index.js index 17fdab5c..f7124ded 100644 --- a/examples/with-firebase/pages/index.js +++ b/examples/with-firebase/pages/index.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import firebase from 'firebase' import 'isomorphic-fetch' -import { clientCredentials } from '../firebaseCredentials' +import clientCredentials from '../credentials/client' export default class Index extends Component { static async getInitialProps ({req, query}) { diff --git a/examples/with-firebase/server.js b/examples/with-firebase/server.js index 1d0d36e8..1e2da2a3 100644 --- a/examples/with-firebase/server.js +++ b/examples/with-firebase/server.js @@ -10,7 +10,7 @@ const app = next({ dev }) const handle = app.getRequestHandler() const firebase = admin.initializeApp({ - credential: admin.credential.cert(require('./firebaseCredentials').serverCredentials), + credential: admin.credential.cert(require('./credentials/server')), databaseURL: '' // TODO database URL goes here }, 'server')