Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added pro tip about env vars related to AuthProcess #161

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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