cognito-local
Advanced tools
Comparing version 3.23.0 to 3.23.1
@@ -8,3 +8,3 @@ export declare class UnsupportedError extends Error { | ||
export declare class NotAuthorizedError extends CognitoError { | ||
constructor(); | ||
constructor(message?: string); | ||
} | ||
@@ -20,2 +20,5 @@ export declare class UserNotFoundError extends CognitoError { | ||
} | ||
export declare class ExpiredCodeError extends CognitoError { | ||
constructor(); | ||
} | ||
export declare class InvalidPasswordError extends CognitoError { | ||
@@ -22,0 +25,0 @@ constructor(); |
@@ -11,2 +11,3 @@ var __defProp = Object.defineProperty; | ||
CognitoError: () => CognitoError, | ||
ExpiredCodeError: () => ExpiredCodeError, | ||
GroupNotFoundError: () => GroupNotFoundError, | ||
@@ -34,4 +35,4 @@ InvalidLambdaResponseError: () => InvalidLambdaResponseError, | ||
class NotAuthorizedError extends CognitoError { | ||
constructor() { | ||
super("NotAuthorizedException", "User not authorized"); | ||
constructor(message = "User not authorized") { | ||
super("NotAuthorizedException", message); | ||
} | ||
@@ -54,2 +55,7 @@ } | ||
} | ||
class ExpiredCodeError extends CognitoError { | ||
constructor() { | ||
super("ExpiredCodeException", "Invalid code provided, please request a code again."); | ||
} | ||
} | ||
class InvalidPasswordError extends CognitoError { | ||
@@ -99,2 +105,3 @@ constructor() { | ||
CognitoError, | ||
ExpiredCodeError, | ||
GroupNotFoundError, | ||
@@ -101,0 +108,0 @@ InvalidLambdaResponseError, |
@@ -56,2 +56,5 @@ var __create = Object.create; | ||
} | ||
if (user.UserStatus !== "UNCONFIRMED") { | ||
throw new import_errors.NotAuthorizedError(`User cannot be confirmed. Current status is ${user.UserStatus}`); | ||
} | ||
const updatedUser = __spreadProps(__spreadValues({}, user), { | ||
@@ -58,0 +61,0 @@ UserLastModifiedDate: clock.get(), |
@@ -56,2 +56,5 @@ var __create = Object.create; | ||
} | ||
if (!user.ConfirmationCode) { | ||
throw new import_errors.ExpiredCodeError(); | ||
} | ||
if (user.ConfirmationCode !== req.ConfirmationCode) { | ||
@@ -58,0 +61,0 @@ throw new import_errors.CodeMismatchError(); |
{ | ||
"name": "cognito-local", | ||
"version": "3.23.0", | ||
"version": "3.23.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "bin": "lib/bin/start.js", |
382697
7673