Skip to content

Commit

Permalink
Update Fauna examples to support new FAUNA_DB_DOMAIN environment vari…
Browse files Browse the repository at this point in the history
…able (#38434)

* Update Fauna examples to support new FAUNA_DB_DOMAIN environment variable.

* Address PR feedback. Reduce interface refactoring

* lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
trevor-fauna and ijjk committed Jul 13, 2022
1 parent b0d64d6 commit b9ad4aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/with-cookie-auth-fauna/utils/fauna-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const serverClient = new faunadb.Client({
// Used for any authed requests.
export const faunaClient = (secret) =>
new faunadb.Client({
secret,
secret: secret,
domain: process.env.FAUNA_DB_DOMAIN ?? 'db.fauna.com',
})

export const serializeFaunaCookie = (userSecret) => {
Expand Down
6 changes: 5 additions & 1 deletion examples/with-fauna/scripts/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ const findImportError = (msg) => {

const main = async () => {
const adminKey = await resolveAdminKey()
const client = new Client({ secret: adminKey })

const client = new Client({
secret: adminKey,
domain: process.env.FAUNA_DB_DOMAIN ?? 'db.fauna.com',
})

if (await isDatabasePrepared({ client })) {
return console.info(
Expand Down

0 comments on commit b9ad4aa

Please sign in to comment.