@yimingliao/cms 0.0.51 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/index.d.ts +49 -68
- package/dist/server/index.js +69 -63
- package/package.json +1 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -102,7 +102,11 @@ interface RateLimiterOptions {
|
|
|
102
102
|
maxAttempts?: number;
|
|
103
103
|
timeWindow?: number;
|
|
104
104
|
}
|
|
105
|
-
declare function createIpRateLimiter(
|
|
105
|
+
declare function createIpRateLimiter({ appName, cache, headers, }: {
|
|
106
|
+
cache: Keyv<unknown>;
|
|
107
|
+
appName: string;
|
|
108
|
+
headers: () => Promise<Headers>;
|
|
109
|
+
}): ({ key: rawKey, maxAttempts, timeWindow, }: RateLimiterOptions) => Promise<boolean>;
|
|
106
110
|
|
|
107
111
|
type Scope = {
|
|
108
112
|
name: string;
|
|
@@ -866,46 +870,57 @@ declare function createAuthMiddleware({ adminRefreshTokenCommandRepository, auth
|
|
|
866
870
|
authenticate(): Promise<AdminFull>;
|
|
867
871
|
};
|
|
868
872
|
|
|
873
|
+
interface ActionContext {
|
|
874
|
+
services: {
|
|
875
|
+
cryptoService: ReturnType<typeof createCryptoService>;
|
|
876
|
+
argon2Service: ReturnType<typeof createArgon2Service>;
|
|
877
|
+
cookieService: ReturnType<typeof createCookieService>;
|
|
878
|
+
};
|
|
879
|
+
repositories: {
|
|
880
|
+
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
881
|
+
adminCommandRepository: ReturnType<typeof createAdminCommandRepository>;
|
|
882
|
+
adminRefreshTokenCommandRepository: ReturnType<typeof createAdminRefreshTokenCommandRepository>;
|
|
883
|
+
};
|
|
884
|
+
useCases: {
|
|
885
|
+
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
886
|
+
};
|
|
887
|
+
middlewares: {
|
|
888
|
+
authMiddleware: ReturnType<typeof createAuthMiddleware>;
|
|
889
|
+
};
|
|
890
|
+
action: {
|
|
891
|
+
executeAction: ReturnType<typeof createExecuteAction>;
|
|
892
|
+
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
893
|
+
};
|
|
894
|
+
emails: {
|
|
895
|
+
emailVerificationEmail: ReturnType<typeof createEmailVerificationEmail>;
|
|
896
|
+
forgotPasswordEmail: ReturnType<typeof createForgotPasswordEmail>;
|
|
897
|
+
};
|
|
898
|
+
http: {
|
|
899
|
+
headers: () => Promise<Headers>;
|
|
900
|
+
};
|
|
901
|
+
schemas: ReturnType<typeof createSchemas>;
|
|
902
|
+
config: {
|
|
903
|
+
accessTokenName: string;
|
|
904
|
+
refreshTokenName: string;
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
|
|
869
908
|
declare const signInValidator: (schemas: ReturnType<typeof createSchemas>) => zod.ZodObject<{
|
|
870
909
|
email: zod.ZodEmail;
|
|
871
910
|
password: zod.ZodString;
|
|
872
911
|
}, zod_v4_core.$strip>;
|
|
873
912
|
|
|
874
913
|
type SignInFormData = zod__default.infer<ReturnType<typeof signInValidator>>;
|
|
875
|
-
|
|
876
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
877
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
878
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
879
|
-
headers: () => Promise<Headers>;
|
|
880
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
881
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
882
|
-
adminRefreshTokenCommandRepository: ReturnType<typeof createAdminRefreshTokenCommandRepository>;
|
|
883
|
-
}
|
|
884
|
-
declare function createSignInAction({ executeAction, ipRateLimiter, authUseCases, headers, schemas, adminQueryRepository, adminRefreshTokenCommandRepository, }: CreateSignInActionParams): ({ formData, deviceInfo, }: {
|
|
914
|
+
declare function createSignInAction(ctx: ActionContext): ({ formData, deviceInfo, }: {
|
|
885
915
|
formData: SignInFormData;
|
|
886
916
|
deviceInfo: DeviceInfo;
|
|
887
917
|
}) => Promise<Result<{
|
|
888
918
|
admin: AdminFull;
|
|
889
919
|
}>>;
|
|
890
920
|
|
|
891
|
-
|
|
892
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
893
|
-
cookieService: ReturnType<typeof createCookieService>;
|
|
894
|
-
cryptoService: ReturnType<typeof createCryptoService>;
|
|
895
|
-
adminRefreshTokenCommandRepository: ReturnType<typeof createAdminRefreshTokenCommandRepository>;
|
|
896
|
-
config: {
|
|
897
|
-
accessTokenName: string;
|
|
898
|
-
refreshTokenName: string;
|
|
899
|
-
};
|
|
900
|
-
}
|
|
901
|
-
declare function createSignOutAction({ executeAction, cookieService, cryptoService, adminRefreshTokenCommandRepository, config, }: CreateSignOutActionParams): () => Promise<Result<void>>;
|
|
921
|
+
declare function createSignOutAction(ctx: ActionContext): () => Promise<Result<void>>;
|
|
902
922
|
|
|
903
|
-
|
|
904
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
905
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
906
|
-
authMiddleware: ReturnType<typeof createAuthMiddleware>;
|
|
907
|
-
}
|
|
908
|
-
declare function createVerifyAction({ executeAction, ipRateLimiter, authMiddleware, }: CreateVerifyActionParams): () => Promise<Result<{
|
|
923
|
+
declare function createVerifyAction(ctx: ActionContext): () => Promise<Result<{
|
|
909
924
|
admin: AdminFull;
|
|
910
925
|
}>>;
|
|
911
926
|
|
|
@@ -916,14 +931,7 @@ declare const changePasswordValidator: (schemas: ReturnType<typeof createSchemas
|
|
|
916
931
|
}, zod_v4_core.$strip>;
|
|
917
932
|
|
|
918
933
|
type ChangePasswordFormData = zod__default.infer<ReturnType<typeof changePasswordValidator>>;
|
|
919
|
-
|
|
920
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
921
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
922
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
923
|
-
authMiddleware: ReturnType<typeof createAuthMiddleware>;
|
|
924
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
925
|
-
}
|
|
926
|
-
declare function createChangePasswordAction({ executeAction, ipRateLimiter, authUseCases, authMiddleware, schemas, }: CreateChangePasswordActionParams): ({ formData, }: {
|
|
934
|
+
declare function createChangePasswordAction(ctx: ActionContext): ({ formData, }: {
|
|
927
935
|
formData: ChangePasswordFormData;
|
|
928
936
|
}) => Promise<Result<void>>;
|
|
929
937
|
|
|
@@ -933,14 +941,7 @@ declare const verifyEmailValidator: (schemas: ReturnType<typeof createSchemas>)
|
|
|
933
941
|
}, zod_v4_core.$strip>;
|
|
934
942
|
|
|
935
943
|
type VerifyEmailFormData = zod__default.infer<ReturnType<typeof verifyEmailValidator>>;
|
|
936
|
-
|
|
937
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
938
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
939
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
940
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
941
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
942
|
-
}
|
|
943
|
-
declare function createVerifyEmailAction({ executeAction, ipRateLimiter, authUseCases, schemas, adminQueryRepository, }: CreateVerifyEmailActionParams): ({ formData, }: {
|
|
944
|
+
declare function createVerifyEmailAction(ctx: ActionContext): ({ formData, }: {
|
|
944
945
|
formData: VerifyEmailFormData;
|
|
945
946
|
}) => Promise<Result<{
|
|
946
947
|
admin: AdminSafe;
|
|
@@ -951,14 +952,7 @@ declare const emailUnverifiedValidator: (schemas: ReturnType<typeof createSchema
|
|
|
951
952
|
}, zod_v4_core.$strip>;
|
|
952
953
|
|
|
953
954
|
type EmailUnverifiedFormData = zod__default.infer<ReturnType<typeof emailUnverifiedValidator>>;
|
|
954
|
-
|
|
955
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
956
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
957
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
958
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
959
|
-
emailVerificationEmail: ReturnType<typeof createEmailVerificationEmail>;
|
|
960
|
-
}
|
|
961
|
-
declare function createEmailUnverifiedAction({ executeAction, ipRateLimiter, schemas, adminQueryRepository, emailVerificationEmail, }: CreateEmailUnverifiedActionParams): ({ formData, }: {
|
|
955
|
+
declare function createEmailUnverifiedAction(ctx: ActionContext): ({ formData, }: {
|
|
962
956
|
formData: EmailUnverifiedFormData;
|
|
963
957
|
}) => Promise<Result<void>>;
|
|
964
958
|
|
|
@@ -967,14 +961,7 @@ declare const forgetPasswordValidator: (schemas: ReturnType<typeof createSchemas
|
|
|
967
961
|
}, zod_v4_core.$strip>;
|
|
968
962
|
|
|
969
963
|
type ForgotPasswordFormData = zod__default.infer<ReturnType<typeof forgetPasswordValidator>>;
|
|
970
|
-
|
|
971
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
972
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
973
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
974
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
975
|
-
forgotPasswordEmail: ReturnType<typeof createForgotPasswordEmail>;
|
|
976
|
-
}
|
|
977
|
-
declare function createForgotPasswordAction({ executeAction, ipRateLimiter, schemas, adminQueryRepository, forgotPasswordEmail, }: CreateForgotPasswordActionParams): ({ formData, }: {
|
|
964
|
+
declare function createForgotPasswordAction(ctx: ActionContext): ({ formData, }: {
|
|
978
965
|
formData: ForgotPasswordFormData;
|
|
979
966
|
}) => Promise<Result<void>>;
|
|
980
967
|
|
|
@@ -985,13 +972,7 @@ declare const resetPasswordValidator: (schemas: ReturnType<typeof createSchemas>
|
|
|
985
972
|
}, zod_v4_core.$strip>;
|
|
986
973
|
|
|
987
974
|
type ResetPasswordFormData = zod__default.infer<ReturnType<typeof resetPasswordValidator>>;
|
|
988
|
-
|
|
989
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
990
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
991
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
992
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
993
|
-
}
|
|
994
|
-
declare function createResetPasswordAction({ executeAction, ipRateLimiter, schemas, authUseCases, }: CreateResetPasswordActionParams): ({ formData, }: {
|
|
975
|
+
declare function createResetPasswordAction(ctx: ActionContext): ({ formData, }: {
|
|
995
976
|
formData: ResetPasswordFormData;
|
|
996
977
|
}) => Promise<Result<void>>;
|
|
997
978
|
|
|
@@ -1013,4 +994,4 @@ declare class ServerError extends Error {
|
|
|
1013
994
|
static internalServerError(): ServerError;
|
|
1014
995
|
}
|
|
1015
996
|
|
|
1016
|
-
export { ADMIN_ORDER_BY, type ChangePasswordFormData, type EmailUnverifiedFormData, type ForgotPasswordFormData, ORDER_BY, POST_ORDER_BY, type RawCacheKey, type ResetPasswordFormData, ServerError, type SignInFormData, type VerifyEmailFormData, createAdminCommandRepository, createAdminQueryRepository, createAdminRefreshTokenCommandRepository, createAdminRefreshTokenQueryRepository, createArgon2Service, createAuthMiddleware, createAuthUseCases, createCache, createCacheResult, createChangePasswordAction, createCookieService, createCryptoService, createEmailUnverifiedAction, createEmailVerificationEmail, createExecuteAction, createExecuteApi, createExist, createFileCommandRepository, createFileQueryRepository, createFileSchema, createFolderCommandRepository, createFolderQueryRepository, createForgotPasswordAction, createForgotPasswordEmail, createIpRateLimiter, createJwtService, createMultiFileSchema, createPostCommandRepository, createPostQueryRepository, createRenderEmailTemplate, createResetPasswordAction, createSchemas, createSendEmail, createSeoMetadataCommandRepository, createSignInAction, createSignOutAction, createTocItemSchema, createTransporter, createUnique, createVerifyAccessToken, createVerifyAction, createVerifyEmailAction, createVerifyRefreshToken, createZod, normalizeCacheKey };
|
|
997
|
+
export { ADMIN_ORDER_BY, type ActionContext, type ChangePasswordFormData, type EmailUnverifiedFormData, type ForgotPasswordFormData, ORDER_BY, POST_ORDER_BY, type RawCacheKey, type ResetPasswordFormData, ServerError, type SignInFormData, type VerifyEmailFormData, createAdminCommandRepository, createAdminQueryRepository, createAdminRefreshTokenCommandRepository, createAdminRefreshTokenQueryRepository, createArgon2Service, createAuthMiddleware, createAuthUseCases, createCache, createCacheResult, createChangePasswordAction, createCookieService, createCryptoService, createEmailUnverifiedAction, createEmailVerificationEmail, createExecuteAction, createExecuteApi, createExist, createFileCommandRepository, createFileQueryRepository, createFileSchema, createFolderCommandRepository, createFolderQueryRepository, createForgotPasswordAction, createForgotPasswordEmail, createIpRateLimiter, createJwtService, createMultiFileSchema, createPostCommandRepository, createPostQueryRepository, createRenderEmailTemplate, createResetPasswordAction, createSchemas, createSendEmail, createSeoMetadataCommandRepository, createSignInAction, createSignOutAction, createTocItemSchema, createTransporter, createUnique, createVerifyAccessToken, createVerifyAction, createVerifyEmailAction, createVerifyRefreshToken, createZod, normalizeCacheKey };
|
package/dist/server/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { SIZE, result, mimeToExtension, classifyFileType } from '../chunk-YAUBKQ
|
|
|
3
3
|
import jwt from 'jsonwebtoken';
|
|
4
4
|
import argon2 from 'argon2';
|
|
5
5
|
import crypto, { timingSafeEqual } from 'crypto';
|
|
6
|
-
import
|
|
6
|
+
import 'next/headers';
|
|
7
7
|
import KeyvRedis from '@keyv/redis';
|
|
8
8
|
import Keyv from 'keyv';
|
|
9
9
|
import { z, ZodError } from 'zod';
|
|
@@ -287,7 +287,11 @@ var lua = `
|
|
|
287
287
|
end
|
|
288
288
|
return current
|
|
289
289
|
`;
|
|
290
|
-
function createIpRateLimiter(
|
|
290
|
+
function createIpRateLimiter({
|
|
291
|
+
appName,
|
|
292
|
+
cache: cache2,
|
|
293
|
+
headers
|
|
294
|
+
}) {
|
|
291
295
|
return async function ipRateLimiter({
|
|
292
296
|
key: rawKey,
|
|
293
297
|
maxAttempts = DEFAULT_MAX_ATTEMPTS,
|
|
@@ -1922,7 +1926,7 @@ function createAuthMiddleware({
|
|
|
1922
1926
|
authUseCases,
|
|
1923
1927
|
verifyAccessToken,
|
|
1924
1928
|
verifyRefreshToken,
|
|
1925
|
-
headers
|
|
1929
|
+
headers
|
|
1926
1930
|
}) {
|
|
1927
1931
|
const authMiddleware = {
|
|
1928
1932
|
async authenticate() {
|
|
@@ -1937,7 +1941,7 @@ function createAuthMiddleware({
|
|
|
1937
1941
|
await authUseCases.refreshTokens({
|
|
1938
1942
|
admin,
|
|
1939
1943
|
deviceInfo: adminRefreshToken.deviceInfo,
|
|
1940
|
-
ip: (await
|
|
1944
|
+
ip: (await headers()).get("x-forwarded-for") || "unknown"
|
|
1941
1945
|
});
|
|
1942
1946
|
return admin;
|
|
1943
1947
|
}
|
|
@@ -2006,19 +2010,21 @@ var signInValidator = (schemas) => schemas.z.object({
|
|
|
2006
2010
|
});
|
|
2007
2011
|
|
|
2008
2012
|
// src/server/interfaces/actions/auth/sign-in/create-sign-in-action.ts
|
|
2009
|
-
function createSignInAction({
|
|
2010
|
-
executeAction,
|
|
2011
|
-
ipRateLimiter,
|
|
2012
|
-
authUseCases,
|
|
2013
|
-
headers: headers2,
|
|
2014
|
-
schemas,
|
|
2015
|
-
adminQueryRepository,
|
|
2016
|
-
adminRefreshTokenCommandRepository
|
|
2017
|
-
}) {
|
|
2013
|
+
function createSignInAction(ctx) {
|
|
2018
2014
|
return async function signInAction({
|
|
2019
2015
|
formData,
|
|
2020
2016
|
deviceInfo
|
|
2021
2017
|
}) {
|
|
2018
|
+
const {
|
|
2019
|
+
repositories: {
|
|
2020
|
+
adminQueryRepository,
|
|
2021
|
+
adminRefreshTokenCommandRepository
|
|
2022
|
+
},
|
|
2023
|
+
useCases: { authUseCases },
|
|
2024
|
+
action: { executeAction, ipRateLimiter },
|
|
2025
|
+
http: { headers },
|
|
2026
|
+
schemas
|
|
2027
|
+
} = ctx;
|
|
2022
2028
|
return executeAction(
|
|
2023
2029
|
async () => {
|
|
2024
2030
|
await ipRateLimiter({ key: ["sign-in"] });
|
|
@@ -2034,7 +2040,7 @@ function createSignInAction({
|
|
|
2034
2040
|
await authUseCases.refreshTokens({
|
|
2035
2041
|
admin,
|
|
2036
2042
|
deviceInfo,
|
|
2037
|
-
ip: (await
|
|
2043
|
+
ip: (await headers()).get("x-forwarded-for") || "unknown"
|
|
2038
2044
|
});
|
|
2039
2045
|
await adminRefreshTokenCommandRepository.deleteManyByExpired();
|
|
2040
2046
|
return {
|
|
@@ -2048,20 +2054,20 @@ function createSignInAction({
|
|
|
2048
2054
|
}
|
|
2049
2055
|
|
|
2050
2056
|
// src/server/interfaces/actions/auth/sign-out/create-sign-out-action.ts
|
|
2051
|
-
function createSignOutAction({
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
}
|
|
2057
|
+
function createSignOutAction(ctx) {
|
|
2058
|
+
const {
|
|
2059
|
+
services: { cryptoService, cookieService },
|
|
2060
|
+
repositories: { adminRefreshTokenCommandRepository },
|
|
2061
|
+
action: { executeAction },
|
|
2062
|
+
config: { accessTokenName, refreshTokenName }
|
|
2063
|
+
} = ctx;
|
|
2058
2064
|
return async function signOutAction() {
|
|
2059
2065
|
return executeAction(
|
|
2060
2066
|
async () => {
|
|
2061
2067
|
let token;
|
|
2062
2068
|
try {
|
|
2063
2069
|
token = await cookieService.getSignedCookie({
|
|
2064
|
-
name:
|
|
2070
|
+
name: refreshTokenName
|
|
2065
2071
|
});
|
|
2066
2072
|
} catch {
|
|
2067
2073
|
}
|
|
@@ -2070,8 +2076,8 @@ function createSignOutAction({
|
|
|
2070
2076
|
tokenHash: cryptoService.hash(token)
|
|
2071
2077
|
});
|
|
2072
2078
|
}
|
|
2073
|
-
await cookieService.delete({ name:
|
|
2074
|
-
await cookieService.delete({ name:
|
|
2079
|
+
await cookieService.delete({ name: accessTokenName });
|
|
2080
|
+
await cookieService.delete({ name: refreshTokenName });
|
|
2075
2081
|
return {
|
|
2076
2082
|
i18nKey: "ok.sign-out-ok"
|
|
2077
2083
|
};
|
|
@@ -2082,11 +2088,11 @@ function createSignOutAction({
|
|
|
2082
2088
|
}
|
|
2083
2089
|
|
|
2084
2090
|
// src/server/interfaces/actions/auth/verify/create-verify-action.ts
|
|
2085
|
-
function createVerifyAction({
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
}
|
|
2091
|
+
function createVerifyAction(ctx) {
|
|
2092
|
+
const {
|
|
2093
|
+
middlewares: { authMiddleware },
|
|
2094
|
+
action: { executeAction, ipRateLimiter }
|
|
2095
|
+
} = ctx;
|
|
2090
2096
|
return async function verifyAction() {
|
|
2091
2097
|
return executeAction(async () => {
|
|
2092
2098
|
await ipRateLimiter({ key: ["verify"], maxAttempts: 60 });
|
|
@@ -2119,16 +2125,16 @@ var changePasswordValidator = (schemas) => schemas.z.object({
|
|
|
2119
2125
|
});
|
|
2120
2126
|
|
|
2121
2127
|
// src/server/interfaces/actions/auth/change-password/create-change-password-action.ts
|
|
2122
|
-
function createChangePasswordAction({
|
|
2123
|
-
executeAction,
|
|
2124
|
-
ipRateLimiter,
|
|
2125
|
-
authUseCases,
|
|
2126
|
-
authMiddleware,
|
|
2127
|
-
schemas
|
|
2128
|
-
}) {
|
|
2128
|
+
function createChangePasswordAction(ctx) {
|
|
2129
2129
|
return async function changePasswordAction({
|
|
2130
2130
|
formData
|
|
2131
2131
|
}) {
|
|
2132
|
+
const {
|
|
2133
|
+
action: { executeAction, ipRateLimiter },
|
|
2134
|
+
useCases: { authUseCases },
|
|
2135
|
+
middlewares: { authMiddleware },
|
|
2136
|
+
schemas
|
|
2137
|
+
} = ctx;
|
|
2132
2138
|
return executeAction(
|
|
2133
2139
|
async () => {
|
|
2134
2140
|
await ipRateLimiter({ key: ["change-password"] });
|
|
@@ -2152,16 +2158,16 @@ var verifyEmailValidator = (schemas) => schemas.z.object({
|
|
|
2152
2158
|
});
|
|
2153
2159
|
|
|
2154
2160
|
// src/server/interfaces/actions/auth/verify-email/create-verify-email-action.ts
|
|
2155
|
-
function createVerifyEmailAction({
|
|
2156
|
-
executeAction,
|
|
2157
|
-
ipRateLimiter,
|
|
2158
|
-
authUseCases,
|
|
2159
|
-
schemas,
|
|
2160
|
-
adminQueryRepository
|
|
2161
|
-
}) {
|
|
2161
|
+
function createVerifyEmailAction(ctx) {
|
|
2162
2162
|
return async function verifyEmailAction({
|
|
2163
2163
|
formData
|
|
2164
2164
|
}) {
|
|
2165
|
+
const {
|
|
2166
|
+
repositories: { adminQueryRepository },
|
|
2167
|
+
useCases: { authUseCases },
|
|
2168
|
+
action: { executeAction, ipRateLimiter },
|
|
2169
|
+
schemas
|
|
2170
|
+
} = ctx;
|
|
2165
2171
|
return executeAction(
|
|
2166
2172
|
async () => {
|
|
2167
2173
|
await ipRateLimiter({ key: ["verify-email"] });
|
|
@@ -2188,16 +2194,16 @@ var emailUnverifiedValidator = (schemas) => schemas.z.object({
|
|
|
2188
2194
|
});
|
|
2189
2195
|
|
|
2190
2196
|
// src/server/interfaces/actions/auth/email-unverifired/create-email-unverifired-action.ts
|
|
2191
|
-
function createEmailUnverifiedAction({
|
|
2192
|
-
executeAction,
|
|
2193
|
-
ipRateLimiter,
|
|
2194
|
-
schemas,
|
|
2195
|
-
adminQueryRepository,
|
|
2196
|
-
emailVerificationEmail
|
|
2197
|
-
}) {
|
|
2197
|
+
function createEmailUnverifiedAction(ctx) {
|
|
2198
2198
|
return async function emailUnverifiedAction({
|
|
2199
2199
|
formData
|
|
2200
2200
|
}) {
|
|
2201
|
+
const {
|
|
2202
|
+
repositories: { adminQueryRepository },
|
|
2203
|
+
action: { executeAction, ipRateLimiter },
|
|
2204
|
+
emails: { emailVerificationEmail },
|
|
2205
|
+
schemas
|
|
2206
|
+
} = ctx;
|
|
2201
2207
|
return executeAction(
|
|
2202
2208
|
async (translator) => {
|
|
2203
2209
|
await ipRateLimiter({
|
|
@@ -2224,16 +2230,16 @@ var forgetPasswordValidator = (schemas) => schemas.z.object({
|
|
|
2224
2230
|
});
|
|
2225
2231
|
|
|
2226
2232
|
// src/server/interfaces/actions/auth/forgot-password/create-forgot-password-action.ts
|
|
2227
|
-
function createForgotPasswordAction({
|
|
2228
|
-
executeAction,
|
|
2229
|
-
ipRateLimiter,
|
|
2230
|
-
schemas,
|
|
2231
|
-
adminQueryRepository,
|
|
2232
|
-
forgotPasswordEmail
|
|
2233
|
-
}) {
|
|
2233
|
+
function createForgotPasswordAction(ctx) {
|
|
2234
2234
|
return async function forgotPasswordAction({
|
|
2235
2235
|
formData
|
|
2236
2236
|
}) {
|
|
2237
|
+
const {
|
|
2238
|
+
repositories: { adminQueryRepository },
|
|
2239
|
+
action: { executeAction, ipRateLimiter },
|
|
2240
|
+
emails: { forgotPasswordEmail },
|
|
2241
|
+
schemas
|
|
2242
|
+
} = ctx;
|
|
2237
2243
|
return executeAction(
|
|
2238
2244
|
async (translator) => {
|
|
2239
2245
|
await ipRateLimiter({
|
|
@@ -2275,15 +2281,15 @@ var resetPasswordValidator = (schemas) => schemas.z.object({
|
|
|
2275
2281
|
});
|
|
2276
2282
|
|
|
2277
2283
|
// src/server/interfaces/actions/auth/reset-password/create-reset-password-action.ts
|
|
2278
|
-
function createResetPasswordAction({
|
|
2279
|
-
executeAction,
|
|
2280
|
-
ipRateLimiter,
|
|
2281
|
-
schemas,
|
|
2282
|
-
authUseCases
|
|
2283
|
-
}) {
|
|
2284
|
+
function createResetPasswordAction(ctx) {
|
|
2284
2285
|
return async function ResetPasswordAction({
|
|
2285
2286
|
formData
|
|
2286
2287
|
}) {
|
|
2288
|
+
const {
|
|
2289
|
+
useCases: { authUseCases },
|
|
2290
|
+
action: { executeAction, ipRateLimiter },
|
|
2291
|
+
schemas
|
|
2292
|
+
} = ctx;
|
|
2287
2293
|
return executeAction(
|
|
2288
2294
|
async () => {
|
|
2289
2295
|
await ipRateLimiter({ key: ["reset-password"] });
|