Skip to content

Commit

Permalink
fix: update auth warning (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickarlt authored Jun 15, 2024
1 parent 3cee0e0 commit fdd411b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/arcgis-rest-request/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,10 @@ export function internalRequest(

/* istanbul ignore else - we don't need to test NOT warning people */
if (
!options.authentication.startsWith("AAPK") && // doesn't look like an API Key
!options.authentication.startsWith("AAPK") &&
!options.authentication.startsWith("AATK") && // doesn't look like an API Key
!options.suppressWarnings && // user doesn't want to suppress warnings for this request
!(globalThis as any).ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING // we havn't shown the user this warning yet
!(globalThis as any).ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING // we haven't shown the user this warning yet
) {
warn(
`Using an oAuth 2.0 access token directly in the token option is discouraged. Consider using ArcGISIdentityManager or Application session. See https://esriurl.com/arcgis-rest-js-direct-token-warning for more information.`
Expand Down

0 comments on commit fdd411b

Please sign in to comment.