strapi-plugin-firebase-authentication 1.1.12 → 1.2.1
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/_chunks/{App-BqjE8BHb.js → App-CAgq2cOo.js} +369 -288
- package/dist/_chunks/{App-BY1gNGKH.mjs → App-CyeC5fLT.mjs} +291 -210
- package/dist/_chunks/api-BL-wXuSb.js +56776 -0
- package/dist/_chunks/api-Bjer83Qp.mjs +56759 -0
- package/dist/_chunks/index-Bg-lGlji.mjs +2758 -0
- package/dist/_chunks/{index-C4t4JZZ_.js → index-CTenjpqN.js} +285 -172
- package/dist/_chunks/{index-D8pv1Q6h.mjs → index-Kidqhaeq.mjs} +268 -155
- package/dist/_chunks/index-Rervtuh1.js +2757 -0
- package/dist/admin/index.js +1 -3
- package/dist/admin/index.mjs +2 -4
- package/dist/admin/src/components/user-management/ResendVerification/ResendVerification.d.ts +9 -0
- package/dist/admin/src/components/user-management/index.d.ts +1 -0
- package/dist/admin/src/pages/Settings/api.d.ts +4 -0
- package/dist/admin/src/pages/utils/api.d.ts +2 -1
- package/dist/server/index.js +1008 -332
- package/dist/server/index.mjs +1008 -332
- package/dist/server/src/config/index.d.ts +1 -1
- package/dist/server/src/content-types/index.d.ts +16 -0
- package/dist/server/src/controllers/firebaseController.d.ts +16 -1
- package/dist/server/src/controllers/index.d.ts +3 -0
- package/dist/server/src/controllers/userController.d.ts +1 -0
- package/dist/server/src/index.d.ts +51 -5
- package/dist/server/src/policies/index.d.ts +3 -1
- package/dist/server/src/policies/is-authenticated.d.ts +6 -0
- package/dist/server/src/routes/content-api.d.ts +10 -2
- package/dist/server/src/routes/index.d.ts +10 -2
- package/dist/server/src/services/emailService.d.ts +10 -0
- package/dist/server/src/services/firebaseService.d.ts +21 -1
- package/dist/server/src/services/index.d.ts +18 -1
- package/dist/server/src/services/settingsService.d.ts +2 -0
- package/dist/server/src/services/tokenService.d.ts +21 -0
- package/dist/server/src/services/userService.d.ts +5 -0
- package/dist/server/src/templates/defaults/email-verification.d.ts +2 -0
- package/dist/server/src/templates/defaults/index.d.ts +1 -0
- package/dist/server/src/templates/types.d.ts +3 -1
- package/package.json +8 -8
- package/dist/_chunks/api-DQCdqlCd.js +0 -35
- package/dist/_chunks/api-D_4cdJU5.mjs +0 -36
- package/dist/_chunks/index-DlPxMuSK.js +0 -814
- package/dist/_chunks/index-DtGfwf9S.mjs +0 -815
|
@@ -66,6 +66,15 @@ declare const _default: {
|
|
|
66
66
|
maximum: number;
|
|
67
67
|
description: string;
|
|
68
68
|
};
|
|
69
|
+
emailVerificationUrl: {
|
|
70
|
+
type: string;
|
|
71
|
+
default: string;
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
emailVerificationEmailSubject: {
|
|
75
|
+
type: string;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
69
78
|
};
|
|
70
79
|
};
|
|
71
80
|
};
|
|
@@ -112,6 +121,13 @@ declare const _default: {
|
|
|
112
121
|
resetTokenExpiresAt: {
|
|
113
122
|
type: string;
|
|
114
123
|
};
|
|
124
|
+
verificationTokenHash: {
|
|
125
|
+
type: string;
|
|
126
|
+
private: boolean;
|
|
127
|
+
};
|
|
128
|
+
verificationTokenExpiresAt: {
|
|
129
|
+
type: string;
|
|
130
|
+
};
|
|
115
131
|
};
|
|
116
132
|
};
|
|
117
133
|
};
|
|
@@ -28,7 +28,7 @@ declare const firebaseController: {
|
|
|
28
28
|
/**
|
|
29
29
|
* Reset password - authenticated password change
|
|
30
30
|
* POST /api/firebase-authentication/resetPassword
|
|
31
|
-
*
|
|
31
|
+
* Authenticated endpoint - requires valid JWT (enforced by is-authenticated policy)
|
|
32
32
|
* Used for admin-initiated resets or user self-service password changes
|
|
33
33
|
* NOT used for forgot password email flow (which uses Firebase's hosted UI)
|
|
34
34
|
*/
|
|
@@ -43,5 +43,20 @@ declare const firebaseController: {
|
|
|
43
43
|
* @returns { success: true, message: "Password has been reset successfully" }
|
|
44
44
|
*/
|
|
45
45
|
resetPasswordWithToken(ctx: Context): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Send email verification - public endpoint
|
|
48
|
+
* POST /api/firebase-authentication/sendVerificationEmail
|
|
49
|
+
* Authenticated endpoint - sends verification email to the logged-in user's email
|
|
50
|
+
*/
|
|
51
|
+
sendVerificationEmail(ctx: Context): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Verify email using custom JWT token
|
|
54
|
+
* POST /api/firebase-authentication/verifyEmail
|
|
55
|
+
* Public endpoint - token provides authentication
|
|
56
|
+
*
|
|
57
|
+
* @param ctx - Koa context with { token } in body
|
|
58
|
+
* @returns { success: true, message: "Email verified successfully" }
|
|
59
|
+
*/
|
|
60
|
+
verifyEmail(ctx: Context): Promise<void>;
|
|
46
61
|
};
|
|
47
62
|
export default firebaseController;
|
|
@@ -8,6 +8,8 @@ declare const _default: {
|
|
|
8
8
|
resetPassword(ctx: any): Promise<void>;
|
|
9
9
|
requestMagicLink(ctx: import("koa").Context): Promise<void>;
|
|
10
10
|
resetPasswordWithToken(ctx: import("koa").Context): Promise<void>;
|
|
11
|
+
sendVerificationEmail(ctx: import("koa").Context): Promise<void>;
|
|
12
|
+
verifyEmail(ctx: import("koa").Context): Promise<void>;
|
|
11
13
|
};
|
|
12
14
|
userController: {
|
|
13
15
|
list: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
|
|
@@ -18,6 +20,7 @@ declare const _default: {
|
|
|
18
20
|
deleteMany: (ctx: any) => Promise<void>;
|
|
19
21
|
resetPassword: (ctx: any) => Promise<void>;
|
|
20
22
|
sendResetEmail: (ctx: any) => Promise<void>;
|
|
23
|
+
sendVerificationEmail: (ctx: any) => Promise<void>;
|
|
21
24
|
};
|
|
22
25
|
settingsController: {
|
|
23
26
|
setFirebaseConfigJson: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
env: any;
|
|
15
15
|
}) => {
|
|
16
16
|
firebaseJsonEncryptionKey: any;
|
|
17
|
-
emailRequired:
|
|
17
|
+
emailRequired: any;
|
|
18
18
|
emailPattern: string;
|
|
19
19
|
};
|
|
20
20
|
validator(config: import("./config").FirebaseAuthConfig): void;
|
|
@@ -29,6 +29,8 @@ declare const _default: {
|
|
|
29
29
|
resetPassword(ctx: any): Promise<void>;
|
|
30
30
|
requestMagicLink(ctx: import("koa").Context): Promise<void>;
|
|
31
31
|
resetPasswordWithToken(ctx: import("koa").Context): Promise<void>;
|
|
32
|
+
sendVerificationEmail(ctx: import("koa").Context): Promise<void>;
|
|
33
|
+
verifyEmail(ctx: import("koa").Context): Promise<void>;
|
|
32
34
|
};
|
|
33
35
|
userController: {
|
|
34
36
|
list: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
|
|
@@ -39,6 +41,7 @@ declare const _default: {
|
|
|
39
41
|
deleteMany: (ctx: any) => Promise<void>;
|
|
40
42
|
resetPassword: (ctx: any) => Promise<void>;
|
|
41
43
|
sendResetEmail: (ctx: any) => Promise<void>;
|
|
44
|
+
sendVerificationEmail: (ctx: any) => Promise<void>;
|
|
42
45
|
};
|
|
43
46
|
settingsController: {
|
|
44
47
|
setFirebaseConfigJson: (ctx: import("koa").Context | import("koa").DefaultContext) => Promise<void>;
|
|
@@ -66,7 +69,7 @@ declare const _default: {
|
|
|
66
69
|
};
|
|
67
70
|
"content-api": {
|
|
68
71
|
type: string;
|
|
69
|
-
routes: {
|
|
72
|
+
routes: ({
|
|
70
73
|
method: string;
|
|
71
74
|
path: string;
|
|
72
75
|
handler: string;
|
|
@@ -74,7 +77,15 @@ declare const _default: {
|
|
|
74
77
|
auth: boolean;
|
|
75
78
|
policies: any[];
|
|
76
79
|
};
|
|
77
|
-
}
|
|
80
|
+
} | {
|
|
81
|
+
method: string;
|
|
82
|
+
path: string;
|
|
83
|
+
handler: string;
|
|
84
|
+
config: {
|
|
85
|
+
policies: string[];
|
|
86
|
+
auth?: undefined;
|
|
87
|
+
};
|
|
88
|
+
})[];
|
|
78
89
|
};
|
|
79
90
|
};
|
|
80
91
|
services: {
|
|
@@ -93,6 +104,8 @@ declare const _default: {
|
|
|
93
104
|
magicLinkUrl: any;
|
|
94
105
|
magicLinkEmailSubject: any;
|
|
95
106
|
magicLinkExpiryHours: any;
|
|
107
|
+
emailVerificationUrl: any;
|
|
108
|
+
emailVerificationEmailSubject: any;
|
|
96
109
|
}>;
|
|
97
110
|
setFirebaseConfigJson(requestBody: any): Promise<any>;
|
|
98
111
|
delFirebaseConfigJson: () => Promise<any>;
|
|
@@ -138,6 +151,7 @@ declare const _default: {
|
|
|
138
151
|
success: boolean;
|
|
139
152
|
message: string;
|
|
140
153
|
}>;
|
|
154
|
+
sendVerificationEmail: (entityId: string) => Promise<any>;
|
|
141
155
|
};
|
|
142
156
|
firebaseService: ({ strapi }: {
|
|
143
157
|
strapi: any;
|
|
@@ -167,7 +181,7 @@ declare const _default: {
|
|
|
167
181
|
forgotPassword: (email: string) => Promise<{
|
|
168
182
|
message: string;
|
|
169
183
|
}>;
|
|
170
|
-
resetPassword: (password: string,
|
|
184
|
+
resetPassword: (password: string, user: any, populate: any[]) => Promise<{
|
|
171
185
|
user: any;
|
|
172
186
|
jwt: any;
|
|
173
187
|
}>;
|
|
@@ -187,6 +201,13 @@ declare const _default: {
|
|
|
187
201
|
requiresFrontend: boolean;
|
|
188
202
|
verificationUrl: any;
|
|
189
203
|
}>;
|
|
204
|
+
sendVerificationEmail(email: string): Promise<{
|
|
205
|
+
message: string;
|
|
206
|
+
}>;
|
|
207
|
+
verifyEmail(token: string): Promise<{
|
|
208
|
+
success: boolean;
|
|
209
|
+
message: string;
|
|
210
|
+
}>;
|
|
190
211
|
};
|
|
191
212
|
templateService: ({ strapi }: {
|
|
192
213
|
strapi: any;
|
|
@@ -211,6 +232,10 @@ declare const _default: {
|
|
|
211
232
|
success: boolean;
|
|
212
233
|
message: string;
|
|
213
234
|
}>;
|
|
235
|
+
sendVerificationEmail(user: any, verificationLink: string): Promise<{
|
|
236
|
+
success: boolean;
|
|
237
|
+
message: string;
|
|
238
|
+
}>;
|
|
214
239
|
};
|
|
215
240
|
firebaseUserDataService: ({ strapi }: {
|
|
216
241
|
strapi: any;
|
|
@@ -237,6 +262,9 @@ declare const _default: {
|
|
|
237
262
|
generateResetToken(firebaseUserDataDocumentId: string): Promise<string>;
|
|
238
263
|
validateResetToken(token: string): Promise<import("./services/tokenService").TokenValidationResult>;
|
|
239
264
|
invalidateResetToken(firebaseUserDataDocumentId: string): Promise<void>;
|
|
265
|
+
generateVerificationToken(firebaseUserDataDocumentId: string, email: string): Promise<string>;
|
|
266
|
+
validateVerificationToken(token: string): Promise<import("./services/tokenService").VerificationTokenValidationResult>;
|
|
267
|
+
invalidateVerificationToken(firebaseUserDataDocumentId: string): Promise<void>;
|
|
240
268
|
};
|
|
241
269
|
};
|
|
242
270
|
contentTypes: {
|
|
@@ -307,6 +335,15 @@ declare const _default: {
|
|
|
307
335
|
maximum: number;
|
|
308
336
|
description: string;
|
|
309
337
|
};
|
|
338
|
+
emailVerificationUrl: {
|
|
339
|
+
type: string;
|
|
340
|
+
default: string;
|
|
341
|
+
description: string;
|
|
342
|
+
};
|
|
343
|
+
emailVerificationEmailSubject: {
|
|
344
|
+
type: string;
|
|
345
|
+
default: string;
|
|
346
|
+
};
|
|
310
347
|
};
|
|
311
348
|
};
|
|
312
349
|
};
|
|
@@ -353,11 +390,20 @@ declare const _default: {
|
|
|
353
390
|
resetTokenExpiresAt: {
|
|
354
391
|
type: string;
|
|
355
392
|
};
|
|
393
|
+
verificationTokenHash: {
|
|
394
|
+
type: string;
|
|
395
|
+
private: boolean;
|
|
396
|
+
};
|
|
397
|
+
verificationTokenExpiresAt: {
|
|
398
|
+
type: string;
|
|
399
|
+
};
|
|
356
400
|
};
|
|
357
401
|
};
|
|
358
402
|
};
|
|
359
403
|
};
|
|
360
|
-
policies: {
|
|
404
|
+
policies: {
|
|
405
|
+
"is-authenticated": (policyContext: any) => Promise<boolean>;
|
|
406
|
+
};
|
|
361
407
|
middlewares: {};
|
|
362
408
|
};
|
|
363
409
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
type: string;
|
|
3
|
-
routes: {
|
|
3
|
+
routes: ({
|
|
4
4
|
method: string;
|
|
5
5
|
path: string;
|
|
6
6
|
handler: string;
|
|
@@ -8,6 +8,14 @@ declare const _default: {
|
|
|
8
8
|
auth: boolean;
|
|
9
9
|
policies: any[];
|
|
10
10
|
};
|
|
11
|
-
}
|
|
11
|
+
} | {
|
|
12
|
+
method: string;
|
|
13
|
+
path: string;
|
|
14
|
+
handler: string;
|
|
15
|
+
config: {
|
|
16
|
+
policies: string[];
|
|
17
|
+
auth?: undefined;
|
|
18
|
+
};
|
|
19
|
+
})[];
|
|
12
20
|
};
|
|
13
21
|
export default _default;
|
|
@@ -12,7 +12,7 @@ declare const _default: {
|
|
|
12
12
|
};
|
|
13
13
|
"content-api": {
|
|
14
14
|
type: string;
|
|
15
|
-
routes: {
|
|
15
|
+
routes: ({
|
|
16
16
|
method: string;
|
|
17
17
|
path: string;
|
|
18
18
|
handler: string;
|
|
@@ -20,7 +20,15 @@ declare const _default: {
|
|
|
20
20
|
auth: boolean;
|
|
21
21
|
policies: any[];
|
|
22
22
|
};
|
|
23
|
-
}
|
|
23
|
+
} | {
|
|
24
|
+
method: string;
|
|
25
|
+
path: string;
|
|
26
|
+
handler: string;
|
|
27
|
+
config: {
|
|
28
|
+
policies: string[];
|
|
29
|
+
auth?: undefined;
|
|
30
|
+
};
|
|
31
|
+
})[];
|
|
24
32
|
};
|
|
25
33
|
};
|
|
26
34
|
export default _default;
|
|
@@ -34,6 +34,16 @@ declare class EmailService {
|
|
|
34
34
|
success: boolean;
|
|
35
35
|
message: string;
|
|
36
36
|
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Send email verification email with three-tier fallback system
|
|
39
|
+
* Tier 1: Strapi Email Plugin (if configured)
|
|
40
|
+
* Tier 2: Custom Hook Function (if provided in config)
|
|
41
|
+
* Tier 3: Development Console Logging (dev mode only)
|
|
42
|
+
*/
|
|
43
|
+
sendVerificationEmail(user: any, verificationLink: string): Promise<{
|
|
44
|
+
success: boolean;
|
|
45
|
+
message: string;
|
|
46
|
+
}>;
|
|
37
47
|
}
|
|
38
48
|
declare const _default: ({ strapi }: {
|
|
39
49
|
strapi: any;
|
|
@@ -85,8 +85,12 @@ declare const _default: ({ strapi }: {
|
|
|
85
85
|
* 2. User-initiated password change (when already authenticated)
|
|
86
86
|
*
|
|
87
87
|
* NOT used for forgot password email flow - that now uses Firebase's hosted UI
|
|
88
|
+
*
|
|
89
|
+
* @param password - New password to set
|
|
90
|
+
* @param user - Authenticated user from ctx.state.user (populated by is-authenticated policy)
|
|
91
|
+
* @param populate - Fields to populate in response
|
|
88
92
|
*/
|
|
89
|
-
resetPassword: (password: string,
|
|
93
|
+
resetPassword: (password: string, user: any, populate: any[]) => Promise<{
|
|
90
94
|
user: any;
|
|
91
95
|
jwt: any;
|
|
92
96
|
}>;
|
|
@@ -111,5 +115,21 @@ declare const _default: ({ strapi }: {
|
|
|
111
115
|
requiresFrontend: boolean;
|
|
112
116
|
verificationUrl: any;
|
|
113
117
|
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Send email verification - public endpoint
|
|
120
|
+
* Generates a verification token and sends an email to the user
|
|
121
|
+
* Security: Always returns generic success message to prevent email enumeration
|
|
122
|
+
*/
|
|
123
|
+
sendVerificationEmail(email: string): Promise<{
|
|
124
|
+
message: string;
|
|
125
|
+
}>;
|
|
126
|
+
/**
|
|
127
|
+
* Verify email with token - public endpoint
|
|
128
|
+
* Validates the token and marks the user's email as verified in Firebase
|
|
129
|
+
*/
|
|
130
|
+
verifyEmail(token: string): Promise<{
|
|
131
|
+
success: boolean;
|
|
132
|
+
message: string;
|
|
133
|
+
}>;
|
|
114
134
|
};
|
|
115
135
|
export default _default;
|
|
@@ -15,6 +15,8 @@ declare const _default: {
|
|
|
15
15
|
magicLinkUrl: any;
|
|
16
16
|
magicLinkEmailSubject: any;
|
|
17
17
|
magicLinkExpiryHours: any;
|
|
18
|
+
emailVerificationUrl: any;
|
|
19
|
+
emailVerificationEmailSubject: any;
|
|
18
20
|
}>;
|
|
19
21
|
setFirebaseConfigJson(requestBody: any): Promise<any>;
|
|
20
22
|
delFirebaseConfigJson: () => Promise<any>;
|
|
@@ -60,6 +62,7 @@ declare const _default: {
|
|
|
60
62
|
success: boolean;
|
|
61
63
|
message: string;
|
|
62
64
|
}>;
|
|
65
|
+
sendVerificationEmail: (entityId: string) => Promise<any>;
|
|
63
66
|
};
|
|
64
67
|
firebaseService: ({ strapi }: {
|
|
65
68
|
strapi: any;
|
|
@@ -89,7 +92,7 @@ declare const _default: {
|
|
|
89
92
|
forgotPassword: (email: string) => Promise<{
|
|
90
93
|
message: string;
|
|
91
94
|
}>;
|
|
92
|
-
resetPassword: (password: string,
|
|
95
|
+
resetPassword: (password: string, user: any, populate: any[]) => Promise<{
|
|
93
96
|
user: any;
|
|
94
97
|
jwt: any;
|
|
95
98
|
}>;
|
|
@@ -109,6 +112,13 @@ declare const _default: {
|
|
|
109
112
|
requiresFrontend: boolean;
|
|
110
113
|
verificationUrl: any;
|
|
111
114
|
}>;
|
|
115
|
+
sendVerificationEmail(email: string): Promise<{
|
|
116
|
+
message: string;
|
|
117
|
+
}>;
|
|
118
|
+
verifyEmail(token: string): Promise<{
|
|
119
|
+
success: boolean;
|
|
120
|
+
message: string;
|
|
121
|
+
}>;
|
|
112
122
|
};
|
|
113
123
|
templateService: ({ strapi }: {
|
|
114
124
|
strapi: any;
|
|
@@ -133,6 +143,10 @@ declare const _default: {
|
|
|
133
143
|
success: boolean;
|
|
134
144
|
message: string;
|
|
135
145
|
}>;
|
|
146
|
+
sendVerificationEmail(user: any, verificationLink: string): Promise<{
|
|
147
|
+
success: boolean;
|
|
148
|
+
message: string;
|
|
149
|
+
}>;
|
|
136
150
|
};
|
|
137
151
|
firebaseUserDataService: ({ strapi }: {
|
|
138
152
|
strapi: any;
|
|
@@ -159,6 +173,9 @@ declare const _default: {
|
|
|
159
173
|
generateResetToken(firebaseUserDataDocumentId: string): Promise<string>;
|
|
160
174
|
validateResetToken(token: string): Promise<import("./tokenService").TokenValidationResult>;
|
|
161
175
|
invalidateResetToken(firebaseUserDataDocumentId: string): Promise<void>;
|
|
176
|
+
generateVerificationToken(firebaseUserDataDocumentId: string, email: string): Promise<string>;
|
|
177
|
+
validateVerificationToken(token: string): Promise<import("./tokenService").VerificationTokenValidationResult>;
|
|
178
|
+
invalidateVerificationToken(firebaseUserDataDocumentId: string): Promise<void>;
|
|
162
179
|
};
|
|
163
180
|
};
|
|
164
181
|
export default _default;
|
|
@@ -29,6 +29,8 @@ declare const _default: ({ strapi }: {
|
|
|
29
29
|
magicLinkUrl: any;
|
|
30
30
|
magicLinkEmailSubject: any;
|
|
31
31
|
magicLinkExpiryHours: any;
|
|
32
|
+
emailVerificationUrl: any;
|
|
33
|
+
emailVerificationEmailSubject: any;
|
|
32
34
|
}>;
|
|
33
35
|
/**
|
|
34
36
|
* Stores and encrypts Firebase configuration including Web API key and password reset settings
|
|
@@ -4,6 +4,9 @@ export interface TokenValidationResult {
|
|
|
4
4
|
firebaseUID: string;
|
|
5
5
|
error?: string;
|
|
6
6
|
}
|
|
7
|
+
export interface VerificationTokenValidationResult extends TokenValidationResult {
|
|
8
|
+
email?: string;
|
|
9
|
+
}
|
|
7
10
|
declare const _default: ({ strapi }: {
|
|
8
11
|
strapi: any;
|
|
9
12
|
}) => {
|
|
@@ -24,5 +27,23 @@ declare const _default: ({ strapi }: {
|
|
|
24
27
|
* @param firebaseUserDataDocumentId - The documentId of the firebase-user-data record
|
|
25
28
|
*/
|
|
26
29
|
invalidateResetToken(firebaseUserDataDocumentId: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Generate an email verification token for a user
|
|
32
|
+
* @param firebaseUserDataDocumentId - The documentId of the firebase-user-data record
|
|
33
|
+
* @param email - The email address at time of request (for change detection)
|
|
34
|
+
* @returns The JWT token to include in the verification URL
|
|
35
|
+
*/
|
|
36
|
+
generateVerificationToken(firebaseUserDataDocumentId: string, email: string): Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Validate an email verification token
|
|
39
|
+
* @param token - The JWT token from the verification URL
|
|
40
|
+
* @returns Validation result with user info and email if valid
|
|
41
|
+
*/
|
|
42
|
+
validateVerificationToken(token: string): Promise<VerificationTokenValidationResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Invalidate a verification token after use
|
|
45
|
+
* @param firebaseUserDataDocumentId - The documentId of the firebase-user-data record
|
|
46
|
+
*/
|
|
47
|
+
invalidateVerificationToken(firebaseUserDataDocumentId: string): Promise<void>;
|
|
27
48
|
};
|
|
28
49
|
export default _default;
|
|
@@ -43,5 +43,10 @@ declare const _default: ({ strapi }: {
|
|
|
43
43
|
success: boolean;
|
|
44
44
|
message: string;
|
|
45
45
|
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Send email verification email (admin-initiated)
|
|
48
|
+
* @param entityId - Firebase UID of the user
|
|
49
|
+
*/
|
|
50
|
+
sendVerificationEmail: (entityId: string) => Promise<any>;
|
|
46
51
|
};
|
|
47
52
|
export default _default;
|
|
@@ -9,6 +9,7 @@ export interface EmailTemplateConfig {
|
|
|
9
9
|
passwordReset?: Partial<EmailTemplate>;
|
|
10
10
|
magicLink?: Partial<EmailTemplate>;
|
|
11
11
|
passwordChanged?: Partial<EmailTemplate>;
|
|
12
|
+
emailVerification?: Partial<EmailTemplate>;
|
|
12
13
|
}
|
|
13
14
|
export interface TemplateVariables {
|
|
14
15
|
user: {
|
|
@@ -22,6 +23,7 @@ export interface TemplateVariables {
|
|
|
22
23
|
link?: string;
|
|
23
24
|
resetLink?: string;
|
|
24
25
|
magicLink?: string;
|
|
26
|
+
verificationLink?: string;
|
|
25
27
|
changedAt?: string;
|
|
26
28
|
appName: string;
|
|
27
29
|
appUrl: string;
|
|
@@ -29,4 +31,4 @@ export interface TemplateVariables {
|
|
|
29
31
|
year: number;
|
|
30
32
|
supportEmail?: string;
|
|
31
33
|
}
|
|
32
|
-
export type TemplateType = "passwordReset" | "magicLink" | "passwordChanged";
|
|
34
|
+
export type TemplateType = "passwordReset" | "magicLink" | "passwordChanged" | "emailVerification";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-firebase-authentication",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Allows easy integration between clients utilizing Firebase for authentication and Strapi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -66,25 +66,25 @@
|
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@strapi/sdk-plugin": "^5.3.2",
|
|
69
|
+
"@strapi/strapi": "^5.0.0",
|
|
69
70
|
"@strapi/typescript-utils": "^5.23.3",
|
|
70
71
|
"@strapi/design-system": "^2.0.0-rc.16",
|
|
71
72
|
"@strapi/icons": "^2.0.0-rc.25",
|
|
72
|
-
"@types/
|
|
73
|
-
"@types/react
|
|
73
|
+
"@types/koa": "^2.15.0",
|
|
74
|
+
"@types/react": "^18.3.0",
|
|
75
|
+
"@types/react-dom": "^18.3.0",
|
|
74
76
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
75
77
|
"@types/validator": "^13.15.3",
|
|
76
78
|
"changelogen": "^0.6.1",
|
|
77
79
|
"prettier": "^3.6.2",
|
|
78
|
-
"react": "^
|
|
79
|
-
"react-dom": "^
|
|
80
|
-
"react-router-dom": "^
|
|
80
|
+
"react": "^18.3.0",
|
|
81
|
+
"react-dom": "^18.3.0",
|
|
82
|
+
"react-router-dom": "^6.28.0",
|
|
81
83
|
"styled-components": "^6.1.19",
|
|
82
84
|
"typescript": "^5.7.3"
|
|
83
85
|
},
|
|
84
86
|
"peerDependencies": {
|
|
85
87
|
"@strapi/strapi": "^5.0.0",
|
|
86
|
-
"@strapi/design-system": "^2.0.0-rc.0",
|
|
87
|
-
"@strapi/icons": "^2.0.0-rc.0",
|
|
88
88
|
"react": "^18.0.0",
|
|
89
89
|
"react-dom": "^18.0.0",
|
|
90
90
|
"react-router-dom": "^6.0.0",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const admin = require("@strapi/strapi/admin");
|
|
3
|
-
const index = require("./index-DlPxMuSK.js");
|
|
4
|
-
const saveFirebaseConfig = async (json, firebaseWebApiKey, passwordConfig) => {
|
|
5
|
-
const url = `/${index.PLUGIN_ID}/settings/firebase-config`;
|
|
6
|
-
const { post } = admin.getFetchClient();
|
|
7
|
-
const { data } = await post(url, {
|
|
8
|
-
firebaseConfigJson: json,
|
|
9
|
-
firebaseWebApiKey,
|
|
10
|
-
...passwordConfig
|
|
11
|
-
});
|
|
12
|
-
return data;
|
|
13
|
-
};
|
|
14
|
-
const getFirebaseConfig = async () => {
|
|
15
|
-
const url = `/${index.PLUGIN_ID}/settings/firebase-config`;
|
|
16
|
-
const { get } = admin.getFetchClient();
|
|
17
|
-
const { data } = await get(url);
|
|
18
|
-
return data;
|
|
19
|
-
};
|
|
20
|
-
const delFirebaseConfig = async () => {
|
|
21
|
-
const url = `/${index.PLUGIN_ID}/settings/firebase-config`;
|
|
22
|
-
const { del } = admin.getFetchClient();
|
|
23
|
-
const { data } = await del(url);
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
const savePasswordSettings = async (passwordConfig) => {
|
|
27
|
-
const url = `/${index.PLUGIN_ID}/settings/password-config`;
|
|
28
|
-
const { post } = admin.getFetchClient();
|
|
29
|
-
const { data } = await post(url, passwordConfig);
|
|
30
|
-
return data;
|
|
31
|
-
};
|
|
32
|
-
exports.delFirebaseConfig = delFirebaseConfig;
|
|
33
|
-
exports.getFirebaseConfig = getFirebaseConfig;
|
|
34
|
-
exports.saveFirebaseConfig = saveFirebaseConfig;
|
|
35
|
-
exports.savePasswordSettings = savePasswordSettings;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { getFetchClient } from "@strapi/strapi/admin";
|
|
2
|
-
import { P as PLUGIN_ID } from "./index-DtGfwf9S.mjs";
|
|
3
|
-
const saveFirebaseConfig = async (json, firebaseWebApiKey, passwordConfig) => {
|
|
4
|
-
const url = `/${PLUGIN_ID}/settings/firebase-config`;
|
|
5
|
-
const { post } = getFetchClient();
|
|
6
|
-
const { data } = await post(url, {
|
|
7
|
-
firebaseConfigJson: json,
|
|
8
|
-
firebaseWebApiKey,
|
|
9
|
-
...passwordConfig
|
|
10
|
-
});
|
|
11
|
-
return data;
|
|
12
|
-
};
|
|
13
|
-
const getFirebaseConfig = async () => {
|
|
14
|
-
const url = `/${PLUGIN_ID}/settings/firebase-config`;
|
|
15
|
-
const { get } = getFetchClient();
|
|
16
|
-
const { data } = await get(url);
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
const delFirebaseConfig = async () => {
|
|
20
|
-
const url = `/${PLUGIN_ID}/settings/firebase-config`;
|
|
21
|
-
const { del } = getFetchClient();
|
|
22
|
-
const { data } = await del(url);
|
|
23
|
-
return data;
|
|
24
|
-
};
|
|
25
|
-
const savePasswordSettings = async (passwordConfig) => {
|
|
26
|
-
const url = `/${PLUGIN_ID}/settings/password-config`;
|
|
27
|
-
const { post } = getFetchClient();
|
|
28
|
-
const { data } = await post(url, passwordConfig);
|
|
29
|
-
return data;
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
savePasswordSettings as a,
|
|
33
|
-
delFirebaseConfig as d,
|
|
34
|
-
getFirebaseConfig as g,
|
|
35
|
-
saveFirebaseConfig as s
|
|
36
|
-
};
|