@locii/biopass-cognito-sdk
Version:
Biopass Cognito Web SDK
53 lines • 2.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isUsernamePasswordOpts = exports.AuthErrorTypes = exports.isCognitoHostedOpts = exports.hasCustomState = exports.isFederatedSignInOptionsCustom = exports.isFederatedSignInOptions = exports.CognitoHostedUIIdentityProvider = void 0;
var CognitoHostedUIIdentityProvider;
(function (CognitoHostedUIIdentityProvider) {
CognitoHostedUIIdentityProvider["Cognito"] = "COGNITO";
CognitoHostedUIIdentityProvider["Google"] = "Google";
CognitoHostedUIIdentityProvider["Facebook"] = "Facebook";
CognitoHostedUIIdentityProvider["Amazon"] = "LoginWithAmazon";
CognitoHostedUIIdentityProvider["Apple"] = "SignInWithApple";
})(CognitoHostedUIIdentityProvider = exports.CognitoHostedUIIdentityProvider || (exports.CognitoHostedUIIdentityProvider = {}));
function isFederatedSignInOptions(obj) {
const keys = ['provider'];
return obj && !!keys.find((k) => obj.hasOwnProperty(k));
}
exports.isFederatedSignInOptions = isFederatedSignInOptions;
function isFederatedSignInOptionsCustom(obj) {
const keys = ['customProvider'];
return obj && !!keys.find((k) => obj.hasOwnProperty(k));
}
exports.isFederatedSignInOptionsCustom = isFederatedSignInOptionsCustom;
function hasCustomState(obj) {
const keys = ['customState'];
return obj && !!keys.find((k) => obj.hasOwnProperty(k));
}
exports.hasCustomState = hasCustomState;
function isCognitoHostedOpts(oauth) {
return oauth.redirectSignIn !== undefined;
}
exports.isCognitoHostedOpts = isCognitoHostedOpts;
var AuthErrorTypes;
(function (AuthErrorTypes) {
AuthErrorTypes["NoConfig"] = "noConfig";
AuthErrorTypes["MissingAuthConfig"] = "missingAuthConfig";
AuthErrorTypes["EmptyUsername"] = "emptyUsername";
AuthErrorTypes["InvalidUsername"] = "invalidUsername";
AuthErrorTypes["EmptyPassword"] = "emptyPassword";
AuthErrorTypes["EmptyCode"] = "emptyCode";
AuthErrorTypes["SignUpError"] = "signUpError";
AuthErrorTypes["NoMFA"] = "noMFA";
AuthErrorTypes["InvalidMFA"] = "invalidMFA";
AuthErrorTypes["EmptyChallengeResponse"] = "emptyChallengeResponse";
AuthErrorTypes["NoUserSession"] = "noUserSession";
AuthErrorTypes["Default"] = "default";
AuthErrorTypes["DeviceConfig"] = "deviceConfig";
AuthErrorTypes["NetworkError"] = "networkError";
AuthErrorTypes["AutoSignInError"] = "autoSignInError";
})(AuthErrorTypes = exports.AuthErrorTypes || (exports.AuthErrorTypes = {}));
function isUsernamePasswordOpts(obj) {
return !!obj.username;
}
exports.isUsernamePasswordOpts = isUsernamePasswordOpts;
//# sourceMappingURL=Auth.js.map