strapi-plugin-firebase-authentication 1.2.0 → 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.
@@ -28,7 +28,7 @@ declare const firebaseController: {
28
28
  /**
29
29
  * Reset password - authenticated password change
30
30
  * POST /api/firebase-authentication/resetPassword
31
- * Public endpoint - requires valid JWT in Authorization header
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
  */
@@ -46,7 +46,7 @@ declare const firebaseController: {
46
46
  /**
47
47
  * Send email verification - public endpoint
48
48
  * POST /api/firebase-authentication/sendVerificationEmail
49
- * Public endpoint - no authentication required
49
+ * Authenticated endpoint - sends verification email to the logged-in user's email
50
50
  */
51
51
  sendVerificationEmail(ctx: Context): Promise<void>;
52
52
  /**
@@ -69,7 +69,7 @@ declare const _default: {
69
69
  };
70
70
  "content-api": {
71
71
  type: string;
72
- routes: {
72
+ routes: ({
73
73
  method: string;
74
74
  path: string;
75
75
  handler: string;
@@ -77,7 +77,15 @@ declare const _default: {
77
77
  auth: boolean;
78
78
  policies: any[];
79
79
  };
80
- }[];
80
+ } | {
81
+ method: string;
82
+ path: string;
83
+ handler: string;
84
+ config: {
85
+ policies: string[];
86
+ auth?: undefined;
87
+ };
88
+ })[];
81
89
  };
82
90
  };
83
91
  services: {
@@ -173,7 +181,7 @@ declare const _default: {
173
181
  forgotPassword: (email: string) => Promise<{
174
182
  message: string;
175
183
  }>;
176
- resetPassword: (password: string, token: string, populate: any[]) => Promise<{
184
+ resetPassword: (password: string, user: any, populate: any[]) => Promise<{
177
185
  user: any;
178
186
  jwt: any;
179
187
  }>;
@@ -393,7 +401,9 @@ declare const _default: {
393
401
  };
394
402
  };
395
403
  };
396
- policies: {};
404
+ policies: {
405
+ "is-authenticated": (policyContext: any) => Promise<boolean>;
406
+ };
397
407
  middlewares: {};
398
408
  };
399
409
  export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: {};
1
+ declare const _default: {
2
+ "is-authenticated": (policyContext: any) => Promise<boolean>;
3
+ };
2
4
  export default _default;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * is-authenticated policy
3
+ * Requires a valid JWT token - returns 401 Unauthorized if not authenticated
4
+ */
5
+ declare const _default: (policyContext: any) => Promise<boolean>;
6
+ 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;
@@ -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, token: string, populate: any[]) => Promise<{
93
+ resetPassword: (password: string, user: any, populate: any[]) => Promise<{
90
94
  user: any;
91
95
  jwt: any;
92
96
  }>;
@@ -92,7 +92,7 @@ declare const _default: {
92
92
  forgotPassword: (email: string) => Promise<{
93
93
  message: string;
94
94
  }>;
95
- resetPassword: (password: string, token: string, populate: any[]) => Promise<{
95
+ resetPassword: (password: string, user: any, populate: any[]) => Promise<{
96
96
  user: any;
97
97
  jwt: any;
98
98
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-firebase-authentication",
3
- "version": "1.2.0",
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/react": "^19.2.2",
73
- "@types/react-dom": "^19.2.1",
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": "^19.2.0",
79
- "react-dom": "^19.2.0",
80
- "react-router-dom": "^7.9.3",
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,36 +0,0 @@
1
- import { getFetchClient } from "@strapi/strapi/admin";
2
- import { P as PLUGIN_ID } from "./index-CMFutRyI.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
- };
@@ -1,35 +0,0 @@
1
- "use strict";
2
- const admin = require("@strapi/strapi/admin");
3
- const index = require("./index-B5EwGI_y.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;