Browse Source

fix(core): Return NotVerifiedError for resetPassword on unverified user

Fixes #1321
Michael Bromley 4 years ago
parent
commit
8257d2740d

File diff suppressed because it is too large
+ 747 - 732
packages/common/src/generated-shop-types.ts


File diff suppressed because it is too large
+ 710 - 695
packages/core/e2e/graphql/generated-e2e-shop-types.ts


+ 3 - 0
packages/core/src/api/resolvers/shop/shop-auth.resolver.ts

@@ -237,6 +237,9 @@ export class ShopAuthResolver extends BaseAuthResolver {
             req,
             req,
             res,
             res,
         );
         );
+        if (isGraphQlErrorResult(authResult) && authResult.__typename === 'NotVerifiedError') {
+            return authResult;
+        }
         if (isGraphQlErrorResult(authResult)) {
         if (isGraphQlErrorResult(authResult)) {
             // This should never occur in theory
             // This should never occur in theory
             throw authResult;
             throw authResult;

+ 1 - 0
packages/core/src/api/schema/shop-api/shop.api.graphql

@@ -239,6 +239,7 @@ union ResetPasswordResult =
     | PasswordResetTokenInvalidError
     | PasswordResetTokenInvalidError
     | PasswordResetTokenExpiredError
     | PasswordResetTokenExpiredError
     | NativeAuthStrategyError
     | NativeAuthStrategyError
+    | NotVerifiedError
 union NativeAuthenticationResult =
 union NativeAuthenticationResult =
       CurrentUser
       CurrentUser
     | InvalidCredentialsError
     | InvalidCredentialsError

File diff suppressed because it is too large
+ 710 - 695
packages/payments-plugin/e2e/graphql/generated-shop-types.ts


File diff suppressed because it is too large
+ 0 - 0
schema-admin.json


File diff suppressed because it is too large
+ 0 - 0
schema-shop.json


Some files were not shown because too many files changed in this diff