Skip to content

Commit

Permalink
added pro tip about env vars related to AuthProcess (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkillam authored Apr 11, 2024
1 parent dc1b4c7 commit 94f3608
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions oauth/connection-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ that define `connection_names`, each incoming request to their functions
will include a `request.auth.connection_name` property indicating which
environment to use for the given request.

:::success Pro Tip
These `AuthProcess` definitions cannot access other environment variables as defined in the [Manage Configuration documentation](../getting-started/environment-variables.md). For example, if you set the following in a `constants.ts` file:

```TypeScript constants.ts
export const API_URL = process.env.API_URL ?? 'https://www.sandbox.example.com/api';
```

`API_URL` will not have access to check the `process.env` if you try to use `API_URL` in your `AuthProcess` definitions which typically results in unexpected values running in a production environment.
:::

## Example
Consider this example (partial) `AuthProcess` definition:

Expand Down

0 comments on commit 94f3608

Please sign in to comment.