strapi-plugin-firebase-authentication 1.5.1 → 1.7.0
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/README.md +218 -450
- package/dist/_chunks/{App-BudX2TEb.js → App-CSFciBSN.js} +2 -2
- package/dist/_chunks/{App-BNGIFY0c.mjs → App-Dzl5W6YR.mjs} +2 -2
- package/dist/_chunks/{api-DVWAqtdZ.mjs → api-BXpBvqeN.mjs} +466 -745
- package/dist/_chunks/{api-CGXMajd1.js → api-C0GYp4ji.js} +466 -745
- package/dist/_chunks/{index-BlUDVi5s.js → index-BEmqy-R3.js} +2 -2
- package/dist/_chunks/{index-BeKccF2n.mjs → index-CCa5Fl4r.mjs} +26 -20
- package/dist/_chunks/{index-DZqOlcC3.js → index-CfYs8WkU.js} +26 -20
- package/dist/_chunks/{index-CSMCJKO0.mjs → index-K_RiV2x9.mjs} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +469 -753
- package/dist/server/index.mjs +471 -753
- package/dist/server/src/migrations/ensure-user-link-unique-constraint.d.ts +22 -0
- package/dist/server/src/migrations/report-orphan-users.d.ts +31 -0
- package/dist/server/src/services/autoLinkService.d.ts +3 -1
- package/package.json +5 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Core } from "@strapi/strapi";
|
|
2
|
+
interface DuplicateInfo {
|
|
3
|
+
user_id: number;
|
|
4
|
+
count: string;
|
|
5
|
+
}
|
|
6
|
+
interface MigrationResult {
|
|
7
|
+
status: "created" | "exists" | "blocked_by_duplicates" | "table_not_found" | "error";
|
|
8
|
+
duplicates?: DuplicateInfo[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Ensure unique constraint on firebase_user_data_user_lnk.user_id
|
|
12
|
+
*
|
|
13
|
+
* This migration:
|
|
14
|
+
* 1. Checks if the unique index already exists (idempotent)
|
|
15
|
+
* 2. Checks for existing duplicates BEFORE trying to create index
|
|
16
|
+
* 3. If duplicates exist: logs warning, returns info, skips creation
|
|
17
|
+
* 4. If no duplicates: creates the unique index
|
|
18
|
+
*
|
|
19
|
+
* SAFE: This only prevents future duplicates, does NOT delete existing data.
|
|
20
|
+
*/
|
|
21
|
+
declare function ensureUserLinkUniqueConstraint(strapi: Core.Strapi): Promise<MigrationResult>;
|
|
22
|
+
export default ensureUserLinkUniqueConstraint;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Core } from "@strapi/strapi";
|
|
2
|
+
interface OrphanReport {
|
|
3
|
+
duplicateEmailGroups: number;
|
|
4
|
+
orphanUsers: Array<{
|
|
5
|
+
id: number;
|
|
6
|
+
email: string;
|
|
7
|
+
username: string;
|
|
8
|
+
created_at: string;
|
|
9
|
+
has_firebase_link: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
usersToKeep: Array<{
|
|
12
|
+
id: number;
|
|
13
|
+
email: string;
|
|
14
|
+
firebase_user_id: string;
|
|
15
|
+
}>;
|
|
16
|
+
emailsNeedingNormalization: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Report potential orphan users created by the email whitespace bug
|
|
20
|
+
*
|
|
21
|
+
* This migration:
|
|
22
|
+
* 1. Finds duplicate emails (with/without whitespace)
|
|
23
|
+
* 2. Identifies which users have Firebase links (KEEP) vs orphans (potential DELETE)
|
|
24
|
+
* 3. ONLY REPORTS - does NOT delete anything
|
|
25
|
+
*
|
|
26
|
+
* Run with: FIREBASE_REPORT_ORPHANS=true yarn develop
|
|
27
|
+
*
|
|
28
|
+
* After reviewing the report, admins can run the cleanup SQL manually.
|
|
29
|
+
*/
|
|
30
|
+
declare function reportOrphanUsers(strapi: Core.Strapi): Promise<OrphanReport | null>;
|
|
31
|
+
export default reportOrphanUsers;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-firebase-authentication",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Allows easy integration between clients utilizing Firebase for authentication and Strapi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
"url": "https://github.com/Meta-CTO/strapi-plugin-firebase-auth/issues"
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/Meta-CTO/strapi-plugin-firebase-auth#readme",
|
|
14
|
-
"
|
|
14
|
+
"authors": [
|
|
15
|
+
"Garrett Fritz <garrett@metacto.com>",
|
|
16
|
+
"Felippe Haeitmann <felippe.haeitmann@metacto.com>"
|
|
17
|
+
],
|
|
15
18
|
"keywords": [
|
|
16
19
|
"strapi5",
|
|
17
20
|
"strapi-plugin"
|