@iterable/react-native-sdk
Version:
Iterable SDK for React Native.
47 lines (46 loc) • 2.7 kB
JavaScript
"use strict";
/**
* The reason for the failure of an authentication attempt.
*
* This is generally related to JWT token validation.
*
* FIXME: Android returns the string (EG: `'AUTH_TOKEN_EXPIRATION_INVALID'`),
* but iOS returns the enum value (EG: `0`). These should be standardized so
* that they both return the same type on either platform.
*/
export let IterableAuthFailureReason = /*#__PURE__*/function (IterableAuthFailureReason) {
/**
* An auth token's expiration must be less than one year from its issued-at
* time.
*/
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_EXPIRATION_INVALID"] = 0] = "AUTH_TOKEN_EXPIRATION_INVALID";
/** The token has expired. */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_EXPIRED"] = 1] = "AUTH_TOKEN_EXPIRED";
/** Token has an invalid format (failed a regular expression check). */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_FORMAT_INVALID"] = 2] = "AUTH_TOKEN_FORMAT_INVALID";
/** `onAuthTokenRequested` threw an exception. */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_GENERATION_ERROR"] = 3] = "AUTH_TOKEN_GENERATION_ERROR";
/** Any other error not captured by another constant. */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_GENERIC_ERROR"] = 4] = "AUTH_TOKEN_GENERIC_ERROR";
/** Iterable has invalidated this token and it cannot be used. */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_INVALIDATED"] = 5] = "AUTH_TOKEN_INVALIDATED";
/** The request to Iterable's API did not include a JWT authorization header. */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_MISSING"] = 6] = "AUTH_TOKEN_MISSING";
/** `onAuthTokenRequested` returned a null JWT token. */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_NULL"] = 7] = "AUTH_TOKEN_NULL";
/**
* Iterable could not decode the token's payload (`iat`, `exp`, `email`,
* or `userId`).
*/
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_PAYLOAD_INVALID"] = 8] = "AUTH_TOKEN_PAYLOAD_INVALID";
/** Iterable could not validate the token's authenticity. */
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_SIGNATURE_INVALID"] = 9] = "AUTH_TOKEN_SIGNATURE_INVALID";
/**
* The token doesn't include an `email` or a `userId`. Or, one of these
* values is included, but it references a user that isn't in the Iterable
* project.
*/
IterableAuthFailureReason[IterableAuthFailureReason["AUTH_TOKEN_USER_KEY_INVALID"] = 10] = "AUTH_TOKEN_USER_KEY_INVALID";
return IterableAuthFailureReason;
}({});
//# sourceMappingURL=IterableAuthFailureReason.js.map