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:
parent
5c57b43e0a
commit
605161df8a
3
examples/with-firebase/credentials/client.js
Normal file
3
examples/with-firebase/credentials/client.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
// TODO firebase client config
|
||||
}
|
3
examples/with-firebase/credentials/server.js
Normal file
3
examples/with-firebase/credentials/server.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
// TODO firebase server config
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
module.exports = {
|
||||
clientCredentials: {
|
||||
// TODO firebase client config
|
||||
},
|
||||
serverCredentials: {
|
||||
// TODO service account json here
|
||||
}
|
||||
}
|
|
@ -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}) {
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
Loading…
Reference in a new issue