"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useAuthentication = exports.AuthenticationContext = exports.CognitoLoginState = void 0;
const react_1 = require("react");
const AsyncAuth_1 = require("../../../util/AsyncAuth");
var CognitoLoginState;
(function (CognitoLoginState) {
    CognitoLoginState["Login"] = "Login";
    CognitoLoginState["RequiresPasswordReset"] = "Reset your password";
    CognitoLoginState["RequiresConfirmation"] = "Verify your email";
    CognitoLoginState["SetupMFA"] = "Setup MFA";
    CognitoLoginState["VerifyMFA"] = "Enter your MFA code";
    CognitoLoginState["RequiresNewPassword"] = "Set up your password";
    CognitoLoginState["Success"] = "Success";
    CognitoLoginState["ForgotPassword"] = "Create a new password";
    CognitoLoginState["CodeMismatch"] = "CodeMismatch";
    CognitoLoginState["UserNotFound"] = "UserNotFound";
    CognitoLoginState["UsernameExists"] = "UsernameExists";
    CognitoLoginState["LimitExceededException"] = "LimitExceededException";
    CognitoLoginState["NotAuthorizedException"] = "NotAuthorizedException";
})(CognitoLoginState || (exports.CognitoLoginState = CognitoLoginState = {}));
(() => __awaiter(void 0, void 0, void 0, function* () {
    const Auth = yield (0, AsyncAuth_1.getAuth)();
    Auth.configure({
        region: 'ap-southeast-2',
        aws_user_pools_id: AWS_USER_POOL_ID,
        aws_user_pools_web_client_id: AWS_USER_POOL_WEB_ID,
    });
}))();
exports.AuthenticationContext = (0, react_1.createContext)({});
const useAuthentication = () => (0, react_1.useContext)(exports.AuthenticationContext);
exports.useAuthentication = useAuthentication;
//# sourceMappingURL=AuthenticationContext.js.map