1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

[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
This commit is contained in:
Elliot Hesp 2017-05-08 20:53:48 +01:00 committed by Tim Neutkens
parent 5c57b43e0a
commit 605161df8a
5 changed files with 8 additions and 10 deletions

View file

@ -0,0 +1,3 @@
module.exports = {
// TODO firebase client config
}

View file

@ -0,0 +1,3 @@
module.exports = {
// TODO firebase server config
}

View file

@ -1,8 +0,0 @@
module.exports = {
clientCredentials: {
// TODO firebase client config
},
serverCredentials: {
// TODO service account json here
}
}

View file

@ -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}) {

View file

@ -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')