@yimingliao/cms 0.0.50 → 0.0.52
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 +51 -69
- package/dist/server/index.js +73 -65
- 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;
|
|
@@ -213,9 +217,10 @@ declare function createSendEmail({ transporter, config, }: {
|
|
|
213
217
|
};
|
|
214
218
|
}): (options: SendEmailOptions) => Promise<any>;
|
|
215
219
|
|
|
216
|
-
declare function createRenderEmailTemplate({
|
|
217
|
-
logoUrl: string;
|
|
220
|
+
declare function createRenderEmailTemplate({ siteName, webUrl, logoUrl, logger, }: {
|
|
218
221
|
siteName: string;
|
|
222
|
+
webUrl: string;
|
|
223
|
+
logoUrl: string;
|
|
219
224
|
logger: Logger;
|
|
220
225
|
}): (templateKey: string, replacements?: Record<string, string>) => Promise<string>;
|
|
221
226
|
|
|
@@ -865,46 +870,57 @@ declare function createAuthMiddleware({ adminRefreshTokenCommandRepository, auth
|
|
|
865
870
|
authenticate(): Promise<AdminFull>;
|
|
866
871
|
};
|
|
867
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
|
+
|
|
868
908
|
declare const signInValidator: (schemas: ReturnType<typeof createSchemas>) => zod.ZodObject<{
|
|
869
909
|
email: zod.ZodEmail;
|
|
870
910
|
password: zod.ZodString;
|
|
871
911
|
}, zod_v4_core.$strip>;
|
|
872
912
|
|
|
873
913
|
type SignInFormData = zod__default.infer<ReturnType<typeof signInValidator>>;
|
|
874
|
-
|
|
875
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
876
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
877
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
878
|
-
headers: () => Promise<Headers>;
|
|
879
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
880
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
881
|
-
adminRefreshTokenCommandRepository: ReturnType<typeof createAdminRefreshTokenCommandRepository>;
|
|
882
|
-
}
|
|
883
|
-
declare function createSignInAction({ executeAction, ipRateLimiter, authUseCases, headers, schemas, adminQueryRepository, adminRefreshTokenCommandRepository, }: CreateSignInActionParams): ({ formData, deviceInfo, }: {
|
|
914
|
+
declare function createSignInAction(ctx: ActionContext): ({ formData, deviceInfo, }: {
|
|
884
915
|
formData: SignInFormData;
|
|
885
916
|
deviceInfo: DeviceInfo;
|
|
886
917
|
}) => Promise<Result<{
|
|
887
918
|
admin: AdminFull;
|
|
888
919
|
}>>;
|
|
889
920
|
|
|
890
|
-
|
|
891
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
892
|
-
cookieService: ReturnType<typeof createCookieService>;
|
|
893
|
-
cryptoService: ReturnType<typeof createCryptoService>;
|
|
894
|
-
adminRefreshTokenCommandRepository: ReturnType<typeof createAdminRefreshTokenCommandRepository>;
|
|
895
|
-
config: {
|
|
896
|
-
accessTokenName: string;
|
|
897
|
-
refreshTokenName: string;
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
declare function createSignOutAction({ executeAction, cookieService, cryptoService, adminRefreshTokenCommandRepository, config, }: CreateSignOutActionParams): () => Promise<Result<void>>;
|
|
921
|
+
declare function createSignOutAction(ctx: ActionContext): () => Promise<Result<void>>;
|
|
901
922
|
|
|
902
|
-
|
|
903
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
904
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
905
|
-
authMiddleware: ReturnType<typeof createAuthMiddleware>;
|
|
906
|
-
}
|
|
907
|
-
declare function createVerifyAction({ executeAction, ipRateLimiter, authMiddleware, }: CreateVerifyActionParams): () => Promise<Result<{
|
|
923
|
+
declare function createVerifyAction(ctx: ActionContext): () => Promise<Result<{
|
|
908
924
|
admin: AdminFull;
|
|
909
925
|
}>>;
|
|
910
926
|
|
|
@@ -915,14 +931,7 @@ declare const changePasswordValidator: (schemas: ReturnType<typeof createSchemas
|
|
|
915
931
|
}, zod_v4_core.$strip>;
|
|
916
932
|
|
|
917
933
|
type ChangePasswordFormData = zod__default.infer<ReturnType<typeof changePasswordValidator>>;
|
|
918
|
-
|
|
919
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
920
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
921
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
922
|
-
authMiddleware: ReturnType<typeof createAuthMiddleware>;
|
|
923
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
924
|
-
}
|
|
925
|
-
declare function createChangePasswordAction({ executeAction, ipRateLimiter, authUseCases, authMiddleware, schemas, }: CreateChangePasswordActionParams): ({ formData, }: {
|
|
934
|
+
declare function createChangePasswordAction(ctx: ActionContext): ({ formData, }: {
|
|
926
935
|
formData: ChangePasswordFormData;
|
|
927
936
|
}) => Promise<Result<void>>;
|
|
928
937
|
|
|
@@ -932,14 +941,7 @@ declare const verifyEmailValidator: (schemas: ReturnType<typeof createSchemas>)
|
|
|
932
941
|
}, zod_v4_core.$strip>;
|
|
933
942
|
|
|
934
943
|
type VerifyEmailFormData = zod__default.infer<ReturnType<typeof verifyEmailValidator>>;
|
|
935
|
-
|
|
936
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
937
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
938
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
939
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
940
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
941
|
-
}
|
|
942
|
-
declare function createVerifyEmailAction({ executeAction, ipRateLimiter, authUseCases, schemas, adminQueryRepository, }: CreateVerifyEmailActionParams): ({ formData, }: {
|
|
944
|
+
declare function createVerifyEmailAction(ctx: ActionContext): ({ formData, }: {
|
|
943
945
|
formData: VerifyEmailFormData;
|
|
944
946
|
}) => Promise<Result<{
|
|
945
947
|
admin: AdminSafe;
|
|
@@ -950,14 +952,7 @@ declare const emailUnverifiedValidator: (schemas: ReturnType<typeof createSchema
|
|
|
950
952
|
}, zod_v4_core.$strip>;
|
|
951
953
|
|
|
952
954
|
type EmailUnverifiedFormData = zod__default.infer<ReturnType<typeof emailUnverifiedValidator>>;
|
|
953
|
-
|
|
954
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
955
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
956
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
957
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
958
|
-
emailVerificationEmail: ReturnType<typeof createEmailVerificationEmail>;
|
|
959
|
-
}
|
|
960
|
-
declare function createEmailUnverifiedAction({ executeAction, ipRateLimiter, schemas, adminQueryRepository, emailVerificationEmail, }: CreateEmailUnverifiedActionParams): ({ formData, }: {
|
|
955
|
+
declare function createEmailUnverifiedAction(ctx: ActionContext): ({ formData, }: {
|
|
961
956
|
formData: EmailUnverifiedFormData;
|
|
962
957
|
}) => Promise<Result<void>>;
|
|
963
958
|
|
|
@@ -966,14 +961,7 @@ declare const forgetPasswordValidator: (schemas: ReturnType<typeof createSchemas
|
|
|
966
961
|
}, zod_v4_core.$strip>;
|
|
967
962
|
|
|
968
963
|
type ForgotPasswordFormData = zod__default.infer<ReturnType<typeof forgetPasswordValidator>>;
|
|
969
|
-
|
|
970
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
971
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
972
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
973
|
-
adminQueryRepository: ReturnType<typeof createAdminQueryRepository>;
|
|
974
|
-
forgotPasswordEmail: ReturnType<typeof createForgotPasswordEmail>;
|
|
975
|
-
}
|
|
976
|
-
declare function createForgotPasswordAction({ executeAction, ipRateLimiter, schemas, adminQueryRepository, forgotPasswordEmail, }: CreateForgotPasswordActionParams): ({ formData, }: {
|
|
964
|
+
declare function createForgotPasswordAction(ctx: ActionContext): ({ formData, }: {
|
|
977
965
|
formData: ForgotPasswordFormData;
|
|
978
966
|
}) => Promise<Result<void>>;
|
|
979
967
|
|
|
@@ -984,13 +972,7 @@ declare const resetPasswordValidator: (schemas: ReturnType<typeof createSchemas>
|
|
|
984
972
|
}, zod_v4_core.$strip>;
|
|
985
973
|
|
|
986
974
|
type ResetPasswordFormData = zod__default.infer<ReturnType<typeof resetPasswordValidator>>;
|
|
987
|
-
|
|
988
|
-
executeAction: ReturnType<typeof createExecuteAction>;
|
|
989
|
-
ipRateLimiter: (options: RateLimiterOptions) => Promise<void>;
|
|
990
|
-
schemas: ReturnType<typeof createSchemas>;
|
|
991
|
-
authUseCases: ReturnType<typeof createAuthUseCases>;
|
|
992
|
-
}
|
|
993
|
-
declare function createResetPasswordAction({ executeAction, ipRateLimiter, schemas, authUseCases, }: CreateResetPasswordActionParams): ({ formData, }: {
|
|
975
|
+
declare function createResetPasswordAction(ctx: ActionContext): ({ formData, }: {
|
|
994
976
|
formData: ResetPasswordFormData;
|
|
995
977
|
}) => Promise<Result<void>>;
|
|
996
978
|
|
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,
|
|
@@ -669,16 +673,18 @@ function applyReplacements(html, replacements, logger) {
|
|
|
669
673
|
});
|
|
670
674
|
}
|
|
671
675
|
function createRenderEmailTemplate({
|
|
672
|
-
logoUrl,
|
|
673
676
|
siteName,
|
|
677
|
+
webUrl,
|
|
678
|
+
logoUrl,
|
|
674
679
|
logger
|
|
675
680
|
}) {
|
|
676
681
|
return async function renderEmailTemplate(templateKey, replacements = {}) {
|
|
677
682
|
try {
|
|
678
683
|
const contentPath = path.join(TEMPLATE_DIR, `${templateKey}.html`);
|
|
679
684
|
const vars = {
|
|
680
|
-
LOGO_URL: logoUrl,
|
|
681
685
|
SITE_NAME: siteName,
|
|
686
|
+
WEB_URL: webUrl,
|
|
687
|
+
LOGO_URL: logoUrl,
|
|
682
688
|
...replacements
|
|
683
689
|
};
|
|
684
690
|
const layoutHtml = await readTemplate(LAYOUT_PATH);
|
|
@@ -1920,7 +1926,7 @@ function createAuthMiddleware({
|
|
|
1920
1926
|
authUseCases,
|
|
1921
1927
|
verifyAccessToken,
|
|
1922
1928
|
verifyRefreshToken,
|
|
1923
|
-
headers
|
|
1929
|
+
headers
|
|
1924
1930
|
}) {
|
|
1925
1931
|
const authMiddleware = {
|
|
1926
1932
|
async authenticate() {
|
|
@@ -1935,7 +1941,7 @@ function createAuthMiddleware({
|
|
|
1935
1941
|
await authUseCases.refreshTokens({
|
|
1936
1942
|
admin,
|
|
1937
1943
|
deviceInfo: adminRefreshToken.deviceInfo,
|
|
1938
|
-
ip: (await
|
|
1944
|
+
ip: (await headers()).get("x-forwarded-for") || "unknown"
|
|
1939
1945
|
});
|
|
1940
1946
|
return admin;
|
|
1941
1947
|
}
|
|
@@ -2004,19 +2010,21 @@ var signInValidator = (schemas) => schemas.z.object({
|
|
|
2004
2010
|
});
|
|
2005
2011
|
|
|
2006
2012
|
// src/server/interfaces/actions/auth/sign-in/create-sign-in-action.ts
|
|
2007
|
-
function createSignInAction({
|
|
2008
|
-
executeAction,
|
|
2009
|
-
ipRateLimiter,
|
|
2010
|
-
authUseCases,
|
|
2011
|
-
headers: headers2,
|
|
2012
|
-
schemas,
|
|
2013
|
-
adminQueryRepository,
|
|
2014
|
-
adminRefreshTokenCommandRepository
|
|
2015
|
-
}) {
|
|
2013
|
+
function createSignInAction(ctx) {
|
|
2016
2014
|
return async function signInAction({
|
|
2017
2015
|
formData,
|
|
2018
2016
|
deviceInfo
|
|
2019
2017
|
}) {
|
|
2018
|
+
const {
|
|
2019
|
+
repositories: {
|
|
2020
|
+
adminQueryRepository,
|
|
2021
|
+
adminRefreshTokenCommandRepository
|
|
2022
|
+
},
|
|
2023
|
+
useCases: { authUseCases },
|
|
2024
|
+
action: { executeAction, ipRateLimiter },
|
|
2025
|
+
http: { headers },
|
|
2026
|
+
schemas
|
|
2027
|
+
} = ctx;
|
|
2020
2028
|
return executeAction(
|
|
2021
2029
|
async () => {
|
|
2022
2030
|
await ipRateLimiter({ key: ["sign-in"] });
|
|
@@ -2032,7 +2040,7 @@ function createSignInAction({
|
|
|
2032
2040
|
await authUseCases.refreshTokens({
|
|
2033
2041
|
admin,
|
|
2034
2042
|
deviceInfo,
|
|
2035
|
-
ip: (await
|
|
2043
|
+
ip: (await headers()).get("x-forwarded-for") || "unknown"
|
|
2036
2044
|
});
|
|
2037
2045
|
await adminRefreshTokenCommandRepository.deleteManyByExpired();
|
|
2038
2046
|
return {
|
|
@@ -2046,20 +2054,20 @@ function createSignInAction({
|
|
|
2046
2054
|
}
|
|
2047
2055
|
|
|
2048
2056
|
// src/server/interfaces/actions/auth/sign-out/create-sign-out-action.ts
|
|
2049
|
-
function createSignOutAction({
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
}
|
|
2057
|
+
function createSignOutAction(ctx) {
|
|
2058
|
+
const {
|
|
2059
|
+
services: { cryptoService, cookieService },
|
|
2060
|
+
repositories: { adminRefreshTokenCommandRepository },
|
|
2061
|
+
action: { executeAction },
|
|
2062
|
+
config: { accessTokenName, refreshTokenName }
|
|
2063
|
+
} = ctx;
|
|
2056
2064
|
return async function signOutAction() {
|
|
2057
2065
|
return executeAction(
|
|
2058
2066
|
async () => {
|
|
2059
2067
|
let token;
|
|
2060
2068
|
try {
|
|
2061
2069
|
token = await cookieService.getSignedCookie({
|
|
2062
|
-
name:
|
|
2070
|
+
name: refreshTokenName
|
|
2063
2071
|
});
|
|
2064
2072
|
} catch {
|
|
2065
2073
|
}
|
|
@@ -2068,8 +2076,8 @@ function createSignOutAction({
|
|
|
2068
2076
|
tokenHash: cryptoService.hash(token)
|
|
2069
2077
|
});
|
|
2070
2078
|
}
|
|
2071
|
-
await cookieService.delete({ name:
|
|
2072
|
-
await cookieService.delete({ name:
|
|
2079
|
+
await cookieService.delete({ name: accessTokenName });
|
|
2080
|
+
await cookieService.delete({ name: refreshTokenName });
|
|
2073
2081
|
return {
|
|
2074
2082
|
i18nKey: "ok.sign-out-ok"
|
|
2075
2083
|
};
|
|
@@ -2080,11 +2088,11 @@ function createSignOutAction({
|
|
|
2080
2088
|
}
|
|
2081
2089
|
|
|
2082
2090
|
// src/server/interfaces/actions/auth/verify/create-verify-action.ts
|
|
2083
|
-
function createVerifyAction({
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
}
|
|
2091
|
+
function createVerifyAction(ctx) {
|
|
2092
|
+
const {
|
|
2093
|
+
middlewares: { authMiddleware },
|
|
2094
|
+
action: { executeAction, ipRateLimiter }
|
|
2095
|
+
} = ctx;
|
|
2088
2096
|
return async function verifyAction() {
|
|
2089
2097
|
return executeAction(async () => {
|
|
2090
2098
|
await ipRateLimiter({ key: ["verify"], maxAttempts: 60 });
|
|
@@ -2117,16 +2125,16 @@ var changePasswordValidator = (schemas) => schemas.z.object({
|
|
|
2117
2125
|
});
|
|
2118
2126
|
|
|
2119
2127
|
// src/server/interfaces/actions/auth/change-password/create-change-password-action.ts
|
|
2120
|
-
function createChangePasswordAction({
|
|
2121
|
-
executeAction,
|
|
2122
|
-
ipRateLimiter,
|
|
2123
|
-
authUseCases,
|
|
2124
|
-
authMiddleware,
|
|
2125
|
-
schemas
|
|
2126
|
-
}) {
|
|
2128
|
+
function createChangePasswordAction(ctx) {
|
|
2127
2129
|
return async function changePasswordAction({
|
|
2128
2130
|
formData
|
|
2129
2131
|
}) {
|
|
2132
|
+
const {
|
|
2133
|
+
action: { executeAction, ipRateLimiter },
|
|
2134
|
+
useCases: { authUseCases },
|
|
2135
|
+
middlewares: { authMiddleware },
|
|
2136
|
+
schemas
|
|
2137
|
+
} = ctx;
|
|
2130
2138
|
return executeAction(
|
|
2131
2139
|
async () => {
|
|
2132
2140
|
await ipRateLimiter({ key: ["change-password"] });
|
|
@@ -2150,16 +2158,16 @@ var verifyEmailValidator = (schemas) => schemas.z.object({
|
|
|
2150
2158
|
});
|
|
2151
2159
|
|
|
2152
2160
|
// src/server/interfaces/actions/auth/verify-email/create-verify-email-action.ts
|
|
2153
|
-
function createVerifyEmailAction({
|
|
2154
|
-
executeAction,
|
|
2155
|
-
ipRateLimiter,
|
|
2156
|
-
authUseCases,
|
|
2157
|
-
schemas,
|
|
2158
|
-
adminQueryRepository
|
|
2159
|
-
}) {
|
|
2161
|
+
function createVerifyEmailAction(ctx) {
|
|
2160
2162
|
return async function verifyEmailAction({
|
|
2161
2163
|
formData
|
|
2162
2164
|
}) {
|
|
2165
|
+
const {
|
|
2166
|
+
repositories: { adminQueryRepository },
|
|
2167
|
+
useCases: { authUseCases },
|
|
2168
|
+
action: { executeAction, ipRateLimiter },
|
|
2169
|
+
schemas
|
|
2170
|
+
} = ctx;
|
|
2163
2171
|
return executeAction(
|
|
2164
2172
|
async () => {
|
|
2165
2173
|
await ipRateLimiter({ key: ["verify-email"] });
|
|
@@ -2186,16 +2194,16 @@ var emailUnverifiedValidator = (schemas) => schemas.z.object({
|
|
|
2186
2194
|
});
|
|
2187
2195
|
|
|
2188
2196
|
// src/server/interfaces/actions/auth/email-unverifired/create-email-unverifired-action.ts
|
|
2189
|
-
function createEmailUnverifiedAction({
|
|
2190
|
-
executeAction,
|
|
2191
|
-
ipRateLimiter,
|
|
2192
|
-
schemas,
|
|
2193
|
-
adminQueryRepository,
|
|
2194
|
-
emailVerificationEmail
|
|
2195
|
-
}) {
|
|
2197
|
+
function createEmailUnverifiedAction(ctx) {
|
|
2196
2198
|
return async function emailUnverifiedAction({
|
|
2197
2199
|
formData
|
|
2198
2200
|
}) {
|
|
2201
|
+
const {
|
|
2202
|
+
repositories: { adminQueryRepository },
|
|
2203
|
+
action: { executeAction, ipRateLimiter },
|
|
2204
|
+
emails: { emailVerificationEmail },
|
|
2205
|
+
schemas
|
|
2206
|
+
} = ctx;
|
|
2199
2207
|
return executeAction(
|
|
2200
2208
|
async (translator) => {
|
|
2201
2209
|
await ipRateLimiter({
|
|
@@ -2222,16 +2230,16 @@ var forgetPasswordValidator = (schemas) => schemas.z.object({
|
|
|
2222
2230
|
});
|
|
2223
2231
|
|
|
2224
2232
|
// src/server/interfaces/actions/auth/forgot-password/create-forgot-password-action.ts
|
|
2225
|
-
function createForgotPasswordAction({
|
|
2226
|
-
executeAction,
|
|
2227
|
-
ipRateLimiter,
|
|
2228
|
-
schemas,
|
|
2229
|
-
adminQueryRepository,
|
|
2230
|
-
forgotPasswordEmail
|
|
2231
|
-
}) {
|
|
2233
|
+
function createForgotPasswordAction(ctx) {
|
|
2232
2234
|
return async function forgotPasswordAction({
|
|
2233
2235
|
formData
|
|
2234
2236
|
}) {
|
|
2237
|
+
const {
|
|
2238
|
+
repositories: { adminQueryRepository },
|
|
2239
|
+
action: { executeAction, ipRateLimiter },
|
|
2240
|
+
emails: { forgotPasswordEmail },
|
|
2241
|
+
schemas
|
|
2242
|
+
} = ctx;
|
|
2235
2243
|
return executeAction(
|
|
2236
2244
|
async (translator) => {
|
|
2237
2245
|
await ipRateLimiter({
|
|
@@ -2273,15 +2281,15 @@ var resetPasswordValidator = (schemas) => schemas.z.object({
|
|
|
2273
2281
|
});
|
|
2274
2282
|
|
|
2275
2283
|
// src/server/interfaces/actions/auth/reset-password/create-reset-password-action.ts
|
|
2276
|
-
function createResetPasswordAction({
|
|
2277
|
-
executeAction,
|
|
2278
|
-
ipRateLimiter,
|
|
2279
|
-
schemas,
|
|
2280
|
-
authUseCases
|
|
2281
|
-
}) {
|
|
2284
|
+
function createResetPasswordAction(ctx) {
|
|
2282
2285
|
return async function ResetPasswordAction({
|
|
2283
2286
|
formData
|
|
2284
2287
|
}) {
|
|
2288
|
+
const {
|
|
2289
|
+
useCases: { authUseCases },
|
|
2290
|
+
action: { executeAction, ipRateLimiter },
|
|
2291
|
+
schemas
|
|
2292
|
+
} = ctx;
|
|
2285
2293
|
return executeAction(
|
|
2286
2294
|
async () => {
|
|
2287
2295
|
await ipRateLimiter({ key: ["reset-password"] });
|