Skip to content

Commit

Permalink
Add configuration warnings about front-end loading
Browse files Browse the repository at this point in the history
  • Loading branch information
zackkatz committed May 2, 2024
1 parent 1560efc commit 8339971
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/Client/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ try {
}
```

:::warning
Make sure initialization happens before headers are sent. `init` is a good hook to use.

**The hook must run on the front-end!** For example, don't use `admin_init`, since it will not run on the front-end.
:::

## All configuration options {#all-options}

| Key | Type | Description | Default | Required? |
Expand Down
15 changes: 15 additions & 0 deletions docs/Client/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ title: Troubleshooting
sidebar_label: Troubleshooting
---

## Redirects happen from the Connector plugin, but logins aren't happening.

This can be caused by Client SDK initialization that is either too late, or initialization that doesn't occur on the front-end. (such as `admin_init`).

- Check to make sure your initialization hook is early enough in the process. `init` is a good default. The `template_redirect` hook is the last possible hook you can use. [Here is an ordered list of WordPress hooks](https://developer.wordpress.org/apis/hooks/action-reference/).
- Make sure your initialization hook is also running on the front-end. If you are using `admin_init`, it will not run on the front-end. Use `init` instead.

### Check the TrustedLogin SDK log

- Enable [logging in the configuration array](/Client/configuration) by setting `logging/enabled` to `true` and `logging/threshold` to `debug`.
- Attempt a login.
- Check the log file (the default location of the log is located at `wp-content/uploads/trustedlogin-logs/trustedlogin-client-debug-{date}-{hash}-.log`)

If there are no new log items, then the Client SDK is not being initialized, likely due to the initialization hook not being early enough in the process or not running on the front-end.

## Troubleshooting the Grant Support Access screen

First things first: make sure you have the [latest version of TrustedLogin](/Client/updating.md) installed.
Expand Down

0 comments on commit 8339971

Please sign in to comment.