checkUrlFragment

client.checkUrlFragment(
    // Optional arguments
    url: string
)

About this command

Checks whether the URL contains a success (AuthResult) or failure (ErrorResponse) response.

If a response is detected, the method returns true and emits the:

  • authenticated event when there is a successful authentication result.

  • authentication_failure event when there is an error response.

Examples

const responseDetected = client.checkUrlFragment()

if (responseDetected) {
  // The `authenticated` event is fired
} else {
  // The `authentication_failure` event is fired
}

Parameters

url string

The URL fragment to which the user-agent is redirected by the server.

Defaults to the location object’s URL.

Response

Type: boolean

Feedback