strapi-plugin-firebase-authentication 1.3.2 → 1.4.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.
Files changed (28) hide show
  1. package/dist/_chunks/{App-DjamRMm8.mjs → App-BetYshSi.mjs} +480 -160
  2. package/dist/_chunks/{App-BmP-duLn.js → App-CvU_Hs6w.js} +592 -251
  3. package/dist/_chunks/{api-Bg075IIT.js → api-e13nzvp3.js} +2 -1
  4. package/dist/_chunks/{api-CLQa5PFi.mjs → api-ut3LjIwN.mjs} +2 -1
  5. package/dist/_chunks/{index-B2NvsXdF.mjs → index-CciifEG2.mjs} +13 -14
  6. package/dist/_chunks/{index-B4ptk_Em.js → index-Cdk5SnH2.js} +1 -1
  7. package/dist/_chunks/{index-CyOVjVQb.js → index-DG0-IQtm.js} +4 -5
  8. package/dist/_chunks/{index-CAZnRswo.mjs → index-LLF37Cdh.mjs} +1 -1
  9. package/dist/admin/index.js +1 -1
  10. package/dist/admin/index.mjs +2 -2
  11. package/dist/admin/src/components/ActivityLog/ActivityLog.d.ts +6 -0
  12. package/dist/admin/src/components/ActivityLog/index.d.ts +1 -0
  13. package/dist/admin/src/pages/utils/api.d.ts +18 -1
  14. package/dist/server/index.js +8147 -30597
  15. package/dist/server/index.mjs +8144 -30589
  16. package/dist/server/src/config/index.d.ts +8 -0
  17. package/dist/server/src/content-types/index.d.ts +74 -0
  18. package/dist/server/src/controllers/activityLogController.d.ts +8 -0
  19. package/dist/server/src/controllers/index.d.ts +3 -0
  20. package/dist/server/src/index.d.ts +93 -1
  21. package/dist/server/src/middlewares/activity-logger.d.ts +9 -0
  22. package/dist/server/src/middlewares/index.d.ts +5 -1
  23. package/dist/server/src/services/activityLogService.d.ts +58 -0
  24. package/dist/server/src/services/firebaseService.d.ts +1 -0
  25. package/dist/server/src/services/firebaseUserDataService.d.ts +1 -0
  26. package/dist/server/src/services/index.d.ts +10 -0
  27. package/dist/server/src/services/userService.d.ts +1 -0
  28. package/package.json +2 -1
@@ -3,9 +3,9 @@ import { Layouts, useQueryParams as useQueryParams$1, getFetchClient, Pagination
3
3
  import { useNavigate, useLocation, useParams, Routes, Route } from "react-router-dom";
4
4
  import { Provider } from "@radix-ui/react-tooltip";
5
5
  import m__default, { useState, useCallback, useMemo, useEffect, useRef, useLayoutEffect } from "react";
6
- import { z as zc, T, R, N as Nn, A as Ar, S as S1, k as k1, a as A1, b as Tr, E, t as t1, v as v1, C as C1, $ as $1, c as bo, w as wo, h as h0, d as a0, o as ot, K as Km, x as x1, G as G0, e as vm, g as getFirebaseConfig$1, F as Fm, D as D1, p as pl } from "./api-CLQa5PFi.mjs";
6
+ import { z as zc, T, R, N as Nn, A as Ar, S as S1, k as k1, a as A1, b as Tr, E, t as t1, v as v1, C as C1, $ as $1, c as bo, w as wo, h as h0, d as a0, o as ot, K as Km, x as x1, G as G0, e as vm, g as getFirebaseConfig$1, F as Fm, D as D1, W as Wd, I as Is, p as pl } from "./api-ut3LjIwN.mjs";
7
7
  import { useIntl } from "react-intl";
8
- import { i as isArguments_1, a as isBufferExports, b as isTypedArray_1, c as isLength_1, d as isFunction_1, _ as _getTag, e as _Stack, f as _equalArrays, g as _equalByTag, h as isObjectLike_1, j as getDefaultExportFromCjs, U as U2, k as _baseGetTag, l as _MapCache, m as _Symbol, n as m3, o as bn, N as Nn$1, Y as Y2, J as J2, P as PLUGIN_ID, p as getAugmentedNamespace, q as commonjsGlobal, u as un, s as sn, r as _3 } from "./index-B2NvsXdF.mjs";
8
+ import { i as isArguments_1, a as isBufferExports, b as isTypedArray_1, c as isLength_1, d as isFunction_1, _ as _getTag, e as _Stack, f as _equalArrays, g as _equalByTag, h as isObjectLike_1, j as getDefaultExportFromCjs, U as U2, k as _baseGetTag, l as _MapCache, m as _Symbol, n as m3, o as bn, N as Nn$1, Y as Y2, J as J2, P as PLUGIN_ID, p as getAugmentedNamespace, q as commonjsGlobal, u as un, s as sn, r as c5, w as w5, t as _3 } from "./index-CciifEG2.mjs";
9
9
  import styled from "styled-components";
10
10
  import { RxCheck, RxCross2 } from "react-icons/rx";
11
11
  import { AiOutlineUserAdd, AiFillPhone, AiFillMail, AiFillYahoo, AiFillGithub, AiFillTwitterCircle, AiFillFacebook, AiFillApple, AiFillGoogleCircle } from "react-icons/ai";
@@ -2711,6 +2711,26 @@ const sendVerificationEmail = async (userId) => {
2711
2711
  const { data: result } = await put(url, {});
2712
2712
  return result;
2713
2713
  };
2714
+ const fetchActivityLogs = async (firebaseUserId, query = {}) => {
2715
+ const { page = 1, pageSize = 10, filters = {} } = query;
2716
+ let url = `/${PLUGIN_ID}/activity-logs?firebaseUserId=${encodeURIComponent(firebaseUserId)}&page=${page}&pageSize=${pageSize}`;
2717
+ if (filters.activityType && filters.activityType !== "all") {
2718
+ url += `&activityType=${encodeURIComponent(filters.activityType)}`;
2719
+ }
2720
+ if (filters.startDate) {
2721
+ url += `&startDate=${encodeURIComponent(filters.startDate)}`;
2722
+ }
2723
+ if (filters.endDate) {
2724
+ url += `&endDate=${encodeURIComponent(filters.endDate)}`;
2725
+ }
2726
+ try {
2727
+ const { get: get2 } = getFetchClient();
2728
+ const { data } = await get2(url);
2729
+ return data;
2730
+ } catch (e2) {
2731
+ return { data: [], meta: { total: 0, page: 1, pageSize: 10 } };
2732
+ }
2733
+ };
2714
2734
  const PaginationFooter = ({ pageCount = 0 }) => {
2715
2735
  const [{ query }, setQuery] = useQueryParams$1();
2716
2736
  const pageSize = query?.pageSize || "10";
@@ -5948,6 +5968,290 @@ const PasswordResetButton = ({
5948
5968
  }
5949
5969
  return button;
5950
5970
  };
5971
+ const LogItem = styled(R)`
5972
+ border-bottom: 1px solid ${({ theme }) => theme.colors.neutral200};
5973
+ padding: 12px 0;
5974
+
5975
+ &:last-child {
5976
+ border-bottom: none;
5977
+ }
5978
+ `;
5979
+ const FilterRow = styled(T)`
5980
+ flex-wrap: wrap;
5981
+ gap: 8px;
5982
+ margin-bottom: 16px;
5983
+ `;
5984
+ const ScrollContainer = styled(R)`
5985
+ max-height: 400px;
5986
+ overflow-y: auto;
5987
+ `;
5988
+ const PaginationRow = styled(T)`
5989
+ margin-top: 16px;
5990
+ justify-content: center;
5991
+ gap: 8px;
5992
+ `;
5993
+ const ExpandableDetails = styled(R)`
5994
+ margin-top: 8px;
5995
+ padding: 12px;
5996
+ background: ${({ theme }) => theme.colors.neutral100};
5997
+ border-radius: 4px;
5998
+ `;
5999
+ const ResponseBodyContainer = styled(R)`
6000
+ margin-top: 8px;
6001
+ padding: 8px;
6002
+ background: ${({ theme }) => theme.colors.neutral0};
6003
+ border-radius: 4px;
6004
+ max-height: 300px;
6005
+ overflow: auto;
6006
+ font-family: monospace;
6007
+ font-size: 12px;
6008
+ white-space: pre-wrap;
6009
+ word-break: break-all;
6010
+ `;
6011
+ const ACTIVITY_TYPE_OPTIONS = [
6012
+ { value: "all", label: "All Types" },
6013
+ { value: "authentication", label: "Authentication" },
6014
+ { value: "tokenValidation", label: "Token Validation" },
6015
+ { value: "fieldUpdate", label: "Field Update" },
6016
+ { value: "passwordReset", label: "Password Reset" },
6017
+ { value: "emailVerification", label: "Email Verification" },
6018
+ { value: "accountCreation", label: "Account Creation" },
6019
+ { value: "accountDeletion", label: "Account Deletion" },
6020
+ { value: "adminAction", label: "Admin Action" }
6021
+ ];
6022
+ const getActivityTypeBadgeColor = (activityType) => {
6023
+ switch (activityType) {
6024
+ case "authentication":
6025
+ return "primary600";
6026
+ case "tokenValidation":
6027
+ return "secondary600";
6028
+ case "fieldUpdate":
6029
+ return "warning600";
6030
+ case "passwordReset":
6031
+ return "danger600";
6032
+ case "emailVerification":
6033
+ return "success600";
6034
+ case "adminAction":
6035
+ return "alternative600";
6036
+ case "accountCreation":
6037
+ return "success600";
6038
+ case "accountDeletion":
6039
+ return "danger600";
6040
+ default:
6041
+ return "neutral600";
6042
+ }
6043
+ };
6044
+ const formatActivityType = (type2) => {
6045
+ return type2.replace(/([A-Z])/g, " $1").trim();
6046
+ };
6047
+ const ActivityLog = ({ firebaseUserId }) => {
6048
+ const [logs, setLogs] = useState([]);
6049
+ const [isLoading, setIsLoading] = useState(true);
6050
+ const [page, setPage] = useState(1);
6051
+ const [totalPages, setTotalPages] = useState(1);
6052
+ const [filters, setFilters] = useState({
6053
+ activityType: "all",
6054
+ startDate: "",
6055
+ endDate: ""
6056
+ });
6057
+ const [expandedRows, setExpandedRows] = useState(/* @__PURE__ */ new Set());
6058
+ const pageSize = 10;
6059
+ const toggleExpand = useCallback((documentId) => {
6060
+ setExpandedRows((prev) => {
6061
+ const next = new Set(prev);
6062
+ if (next.has(documentId)) {
6063
+ next.delete(documentId);
6064
+ } else {
6065
+ next.add(documentId);
6066
+ }
6067
+ return next;
6068
+ });
6069
+ }, []);
6070
+ const hasExpandableContent = useCallback((log) => {
6071
+ return log.metadata?.responseBody || log.endpoint || log.userAgent;
6072
+ }, []);
6073
+ const loadLogs = useCallback(async () => {
6074
+ if (!firebaseUserId) return;
6075
+ setIsLoading(true);
6076
+ try {
6077
+ const response = await fetchActivityLogs(firebaseUserId, {
6078
+ page,
6079
+ pageSize,
6080
+ filters: {
6081
+ activityType: filters.activityType !== "all" ? filters.activityType : void 0,
6082
+ startDate: filters.startDate || void 0,
6083
+ endDate: filters.endDate || void 0
6084
+ }
6085
+ });
6086
+ setLogs(response.data || []);
6087
+ setTotalPages(Math.ceil((response.meta?.total || 0) / pageSize));
6088
+ } catch (error) {
6089
+ console.error("Failed to fetch activity logs:", error);
6090
+ setLogs([]);
6091
+ } finally {
6092
+ setIsLoading(false);
6093
+ }
6094
+ }, [firebaseUserId, page, pageSize, filters]);
6095
+ useEffect(() => {
6096
+ loadLogs();
6097
+ }, [loadLogs]);
6098
+ const handleFilterChange = useCallback((field, value) => {
6099
+ setFilters((prev) => ({ ...prev, [field]: value }));
6100
+ setPage(1);
6101
+ }, []);
6102
+ const handleClearFilters = useCallback(() => {
6103
+ setFilters({
6104
+ activityType: "all",
6105
+ startDate: "",
6106
+ endDate: ""
6107
+ });
6108
+ setPage(1);
6109
+ }, []);
6110
+ const renderChanges = (changes) => {
6111
+ return Object.entries(changes).map(([field, { old: oldVal, new: newVal }]) => /* @__PURE__ */ jsxs(T, { gap: 2, marginTop: 1, alignItems: "center", wrap: "nowrap", children: [
6112
+ /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "neutral600", style: { minWidth: "100px" }, children: [
6113
+ field,
6114
+ ":"
6115
+ ] }),
6116
+ /* @__PURE__ */ jsx(E, { variant: "pi", textColor: "danger600", style: { textDecoration: "line-through" }, children: String(oldVal ?? "none") }),
6117
+ /* @__PURE__ */ jsx(E, { variant: "pi", textColor: "neutral600", children: "→" }),
6118
+ /* @__PURE__ */ jsx(E, { variant: "pi", textColor: "success600", children: String(newVal ?? "none") })
6119
+ ] }, field));
6120
+ };
6121
+ return /* @__PURE__ */ jsxs(R, { children: [
6122
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", marginBottom: 3, children: "Activity History" }),
6123
+ /* @__PURE__ */ jsxs(FilterRow, { children: [
6124
+ /* @__PURE__ */ jsx(R, { style: { minWidth: "150px" }, children: /* @__PURE__ */ jsx(
6125
+ bo,
6126
+ {
6127
+ label: "Activity Type",
6128
+ value: filters.activityType,
6129
+ onChange: (value) => handleFilterChange("activityType", value),
6130
+ size: "S",
6131
+ children: ACTIVITY_TYPE_OPTIONS.map((option) => /* @__PURE__ */ jsx(wo, { value: option.value, children: option.label }, option.value))
6132
+ }
6133
+ ) }),
6134
+ /* @__PURE__ */ jsx(R, { style: { minWidth: "140px" }, children: /* @__PURE__ */ jsx(
6135
+ G0,
6136
+ {
6137
+ label: "Start Date",
6138
+ type: "date",
6139
+ value: filters.startDate,
6140
+ onChange: (e2) => handleFilterChange("startDate", e2.target.value),
6141
+ size: "S"
6142
+ }
6143
+ ) }),
6144
+ /* @__PURE__ */ jsx(R, { style: { minWidth: "140px" }, children: /* @__PURE__ */ jsx(
6145
+ G0,
6146
+ {
6147
+ label: "End Date",
6148
+ type: "date",
6149
+ value: filters.endDate,
6150
+ onChange: (e2) => handleFilterChange("endDate", e2.target.value),
6151
+ size: "S"
6152
+ }
6153
+ ) }),
6154
+ /* @__PURE__ */ jsx(R, { style: { alignSelf: "flex-end" }, children: /* @__PURE__ */ jsx(Nn, { variant: "tertiary", size: "S", onClick: handleClearFilters, children: "Clear" }) })
6155
+ ] }),
6156
+ isLoading ? /* @__PURE__ */ jsx(T, { justifyContent: "center", padding: 4, children: /* @__PURE__ */ jsx(Wd, { small: true, children: "Loading activity logs..." }) }) : logs.length === 0 ? /* @__PURE__ */ jsx(E, { variant: "pi", textColor: "neutral600", children: "No activity logs found." }) : /* @__PURE__ */ jsxs(Fragment, { children: [
6157
+ /* @__PURE__ */ jsx(ScrollContainer, { children: logs.map((log) => /* @__PURE__ */ jsx(LogItem, { children: /* @__PURE__ */ jsxs(T, { justifyContent: "space-between", alignItems: "flex-start", children: [
6158
+ /* @__PURE__ */ jsxs(T, { direction: "column", gap: 1, alignItems: "flex-start", style: { flex: 1 }, children: [
6159
+ /* @__PURE__ */ jsxs(T, { gap: 2, alignItems: "center", children: [
6160
+ hasExpandableContent(log) && /* @__PURE__ */ jsx(
6161
+ ot,
6162
+ {
6163
+ onClick: () => toggleExpand(log.documentId),
6164
+ label: expandedRows.has(log.documentId) ? "Collapse" : "Expand",
6165
+ variant: "ghost",
6166
+ size: "S",
6167
+ children: expandedRows.has(log.documentId) ? /* @__PURE__ */ jsx(c5, {}) : /* @__PURE__ */ jsx(w5, {})
6168
+ }
6169
+ ),
6170
+ /* @__PURE__ */ jsx(Is, { textColor: getActivityTypeBadgeColor(log.activityType), size: "S", children: formatActivityType(log.activityType) }),
6171
+ log.activityType !== "fieldUpdate" && /* @__PURE__ */ jsx(E, { variant: "omega", fontWeight: "semiBold", children: log.action }),
6172
+ log.metadata?.statusCode && /* @__PURE__ */ jsx(
6173
+ Is,
6174
+ {
6175
+ textColor: log.metadata.statusCode >= 400 ? "danger600" : "success600",
6176
+ size: "S",
6177
+ children: log.metadata.statusCode
6178
+ }
6179
+ ),
6180
+ !log.success && /* @__PURE__ */ jsx(Is, { textColor: "danger600", size: "S", children: "Failed" })
6181
+ ] }),
6182
+ log.changes && Object.keys(log.changes).length > 0 && /* @__PURE__ */ jsx(R, { marginTop: 1, children: renderChanges(log.changes) }),
6183
+ log.errorMessage && /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "danger600", marginTop: 1, children: [
6184
+ "Error: ",
6185
+ log.errorMessage
6186
+ ] }),
6187
+ expandedRows.has(log.documentId) && hasExpandableContent(log) && /* @__PURE__ */ jsx(ExpandableDetails, { children: /* @__PURE__ */ jsxs(T, { direction: "column", gap: 2, children: [
6188
+ log.endpoint && /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "neutral600", children: [
6189
+ /* @__PURE__ */ jsx("strong", { children: "Endpoint:" }),
6190
+ " ",
6191
+ log.method,
6192
+ " ",
6193
+ log.endpoint
6194
+ ] }),
6195
+ log.metadata?.responseTime && /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "neutral600", children: [
6196
+ /* @__PURE__ */ jsx("strong", { children: "Response Time:" }),
6197
+ " ",
6198
+ log.metadata.responseTime,
6199
+ "ms"
6200
+ ] }),
6201
+ log.metadata?.statusCode && /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "neutral600", children: [
6202
+ /* @__PURE__ */ jsx("strong", { children: "Status Code:" }),
6203
+ " ",
6204
+ log.metadata.statusCode
6205
+ ] }),
6206
+ log.userAgent && /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "neutral600", children: [
6207
+ /* @__PURE__ */ jsx("strong", { children: "User Agent:" }),
6208
+ " ",
6209
+ log.userAgent
6210
+ ] }),
6211
+ log.ipAddress && /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "neutral600", children: [
6212
+ /* @__PURE__ */ jsx("strong", { children: "IP Address:" }),
6213
+ " ",
6214
+ log.ipAddress
6215
+ ] }),
6216
+ log.metadata?.responseBody && /* @__PURE__ */ jsxs(R, { marginTop: 2, children: [
6217
+ /* @__PURE__ */ jsx(E, { variant: "pi", textColor: "neutral600", fontWeight: "semiBold", children: "Response:" }),
6218
+ /* @__PURE__ */ jsx(ResponseBodyContainer, { children: JSON.stringify(log.metadata.responseBody, null, 2) })
6219
+ ] })
6220
+ ] }) })
6221
+ ] }),
6222
+ /* @__PURE__ */ jsx(E, { variant: "pi", textColor: "neutral500", children: format(new Date(log.createdAt), "yyyy/MM/dd HH:mm") })
6223
+ ] }) }, log.documentId)) }),
6224
+ totalPages > 1 && /* @__PURE__ */ jsxs(PaginationRow, { children: [
6225
+ /* @__PURE__ */ jsx(
6226
+ Nn,
6227
+ {
6228
+ variant: "tertiary",
6229
+ size: "S",
6230
+ disabled: page === 1,
6231
+ onClick: () => setPage((p) => Math.max(1, p - 1)),
6232
+ children: "Previous"
6233
+ }
6234
+ ),
6235
+ /* @__PURE__ */ jsxs(E, { variant: "pi", textColor: "neutral600", children: [
6236
+ "Page ",
6237
+ page,
6238
+ " of ",
6239
+ totalPages
6240
+ ] }),
6241
+ /* @__PURE__ */ jsx(
6242
+ Nn,
6243
+ {
6244
+ variant: "tertiary",
6245
+ size: "S",
6246
+ disabled: page === totalPages,
6247
+ onClick: () => setPage((p) => Math.min(totalPages, p + 1)),
6248
+ children: "Next"
6249
+ }
6250
+ )
6251
+ ] })
6252
+ ] })
6253
+ ] });
6254
+ };
5951
6255
  const MetaWrapper = styled(R)`
5952
6256
  width: 100%;
5953
6257
  display: flex;
@@ -6091,177 +6395,193 @@ const EditUserForm = ({ data }) => {
6091
6395
  isSubmitButtonDisabled: isSubmitDisabled
6092
6396
  }
6093
6397
  ),
6094
- /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
6095
- UserFormLayout,
6096
- {
6097
- sidebar: /* @__PURE__ */ jsxs(Fragment, { children: [
6098
- /* @__PURE__ */ jsxs(
6099
- R,
6100
- {
6101
- as: "aside",
6102
- background: "neutral0",
6103
- borderColor: "neutral150",
6104
- hasRadius: true,
6105
- paddingBottom: 2,
6106
- paddingLeft: 4,
6107
- paddingRight: 4,
6108
- paddingTop: 2,
6109
- shadow: "tableShadow",
6110
- children: [
6111
- /* @__PURE__ */ jsxs(T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 2, children: [
6112
- /* @__PURE__ */ jsxs(T, { gap: 1, children: [
6113
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Firebase User ID:" }),
6114
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: userData.firebaseUserID || userData.uid })
6115
- ] }),
6116
- locationState?.strapiId && /* @__PURE__ */ jsxs(T, { gap: 1, children: [
6117
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Strapi ID:" }),
6118
- /* @__PURE__ */ jsx(
6119
- E,
6120
- {
6121
- variant: "sigma",
6122
- textColor: "primary600",
6123
- component: "a",
6124
- onClick: (e2) => {
6125
- e2.preventDefault();
6126
- navigate(
6127
- `/content-manager/collection-types/plugin::users-permissions.user/${userData.strapiDocumentId || userData.documentId || locationState.strapiDocumentId}`
6128
- );
6129
- },
6130
- style: {
6131
- cursor: "pointer",
6132
- textDecoration: "underline"
6133
- },
6134
- children: locationState.strapiId
6135
- }
6136
- )
6137
- ] })
6138
- ] }),
6139
- /* @__PURE__ */ jsx(pl, {}),
6140
- userData.providerData?.map((provider, index) => /* @__PURE__ */ jsxs(m__default.Fragment, { children: [
6141
- index > 0 && /* @__PURE__ */ jsx(pl, {}),
6398
+ /* @__PURE__ */ jsxs(Layouts.Content, { children: [
6399
+ /* @__PURE__ */ jsx(
6400
+ UserFormLayout,
6401
+ {
6402
+ sidebar: /* @__PURE__ */ jsxs(Fragment, { children: [
6403
+ /* @__PURE__ */ jsxs(
6404
+ R,
6405
+ {
6406
+ as: "aside",
6407
+ background: "neutral0",
6408
+ borderColor: "neutral150",
6409
+ hasRadius: true,
6410
+ paddingBottom: 2,
6411
+ paddingLeft: 4,
6412
+ paddingRight: 4,
6413
+ paddingTop: 2,
6414
+ shadow: "tableShadow",
6415
+ children: [
6142
6416
  /* @__PURE__ */ jsxs(T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 2, children: [
6143
6417
  /* @__PURE__ */ jsxs(T, { gap: 1, children: [
6144
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Provider:" }),
6145
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: provider.providerId })
6418
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Firebase User ID:" }),
6419
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: userData.firebaseUserID || userData.uid })
6146
6420
  ] }),
6147
- /* @__PURE__ */ jsxs(T, { gap: 1, children: [
6148
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Identifier:" }),
6149
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: provider.uid })
6421
+ locationState?.strapiId && /* @__PURE__ */ jsxs(T, { gap: 1, children: [
6422
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Strapi ID:" }),
6423
+ /* @__PURE__ */ jsx(
6424
+ E,
6425
+ {
6426
+ variant: "sigma",
6427
+ textColor: "primary600",
6428
+ component: "a",
6429
+ onClick: (e2) => {
6430
+ e2.preventDefault();
6431
+ navigate(
6432
+ `/content-manager/collection-types/plugin::users-permissions.user/${userData.strapiDocumentId || userData.documentId || locationState.strapiDocumentId}`
6433
+ );
6434
+ },
6435
+ style: {
6436
+ cursor: "pointer",
6437
+ textDecoration: "underline"
6438
+ },
6439
+ children: locationState.strapiId
6440
+ }
6441
+ )
6150
6442
  ] })
6151
- ] })
6152
- ] }, index)),
6153
- /* @__PURE__ */ jsx(pl, {}),
6154
- /* @__PURE__ */ jsxs(T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 3, children: [
6155
- userData.metadata?.lastSignInTime && /* @__PURE__ */ jsxs(MetaWrapper, { children: [
6156
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Last Sign In Time" }),
6157
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: format(new Date(userData.metadata.lastSignInTime), "yyyy/MM/dd HH:mm z") })
6158
6443
  ] }),
6159
- (userData.metadata?.creationTime || userData.createdAt) && /* @__PURE__ */ jsxs(MetaWrapper, { children: [
6160
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Creation Time" }),
6161
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: userData.metadata?.creationTime ? format(new Date(userData.metadata.creationTime), "yyyy/MM/dd HH:mm z") : userData.createdAt ? format(new Date(userData.createdAt), "yyyy/MM/dd HH:mm z") : "-" })
6444
+ /* @__PURE__ */ jsx(pl, {}),
6445
+ userData.providerData?.map((provider, index) => /* @__PURE__ */ jsxs(m__default.Fragment, { children: [
6446
+ index > 0 && /* @__PURE__ */ jsx(pl, {}),
6447
+ /* @__PURE__ */ jsxs(T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 2, children: [
6448
+ /* @__PURE__ */ jsxs(T, { gap: 1, children: [
6449
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Provider:" }),
6450
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: provider.providerId })
6451
+ ] }),
6452
+ /* @__PURE__ */ jsxs(T, { gap: 1, children: [
6453
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Identifier:" }),
6454
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: provider.uid })
6455
+ ] })
6456
+ ] })
6457
+ ] }, index)),
6458
+ /* @__PURE__ */ jsx(pl, {}),
6459
+ /* @__PURE__ */ jsxs(T, { paddingTop: 2, paddingBottom: 2, direction: "column", alignItems: "flex-start", gap: 3, children: [
6460
+ userData.metadata?.lastSignInTime && /* @__PURE__ */ jsxs(MetaWrapper, { children: [
6461
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Last Sign In Time" }),
6462
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: format(new Date(userData.metadata.lastSignInTime), "yyyy/MM/dd HH:mm z") })
6463
+ ] }),
6464
+ (userData.metadata?.creationTime || userData.createdAt) && /* @__PURE__ */ jsxs(MetaWrapper, { children: [
6465
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "Creation Time" }),
6466
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: userData.metadata?.creationTime ? format(new Date(userData.metadata.creationTime), "yyyy/MM/dd HH:mm z") : userData.createdAt ? format(new Date(userData.createdAt), "yyyy/MM/dd HH:mm z") : "-" })
6467
+ ] })
6162
6468
  ] })
6163
- ] })
6164
- ]
6165
- }
6166
- ),
6167
- /* @__PURE__ */ jsx(R, { marginTop: 5, marginBottom: 5 }),
6168
- /* @__PURE__ */ jsxs(
6169
- R,
6170
- {
6171
- as: "aside",
6172
- background: "neutral0",
6173
- borderColor: "neutral150",
6174
- hasRadius: true,
6175
- paddingBottom: 4,
6176
- paddingLeft: 4,
6177
- paddingRight: 4,
6178
- paddingTop: 4,
6179
- shadow: "tableShadow",
6180
- children: [
6181
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", marginBottom: 2, children: "Account Actions" }),
6182
- /* @__PURE__ */ jsxs(T, { direction: "column", gap: 2, children: [
6183
- /* @__PURE__ */ jsx(
6184
- PasswordResetButton,
6185
- {
6186
- user: userData,
6187
- fullWidth: true,
6188
- onClick: () => {
6189
- setShowResetPasswordDialog({
6190
- isOpen: true,
6191
- email: userData.email || "",
6192
- id: userData.uid || ""
6193
- });
6469
+ ]
6470
+ }
6471
+ ),
6472
+ /* @__PURE__ */ jsx(R, { marginTop: 5, marginBottom: 5 }),
6473
+ /* @__PURE__ */ jsxs(
6474
+ R,
6475
+ {
6476
+ as: "aside",
6477
+ background: "neutral0",
6478
+ borderColor: "neutral150",
6479
+ hasRadius: true,
6480
+ paddingBottom: 4,
6481
+ paddingLeft: 4,
6482
+ paddingRight: 4,
6483
+ paddingTop: 4,
6484
+ shadow: "tableShadow",
6485
+ children: [
6486
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", marginBottom: 2, children: "Account Actions" }),
6487
+ /* @__PURE__ */ jsxs(T, { direction: "column", gap: 2, children: [
6488
+ /* @__PURE__ */ jsx(
6489
+ PasswordResetButton,
6490
+ {
6491
+ user: userData,
6492
+ fullWidth: true,
6493
+ onClick: () => {
6494
+ setShowResetPasswordDialog({
6495
+ isOpen: true,
6496
+ email: userData.email || "",
6497
+ id: userData.uid || ""
6498
+ });
6499
+ }
6194
6500
  }
6195
- }
6196
- ),
6197
- userData.email && !userData.emailVerified && /* @__PURE__ */ jsx(
6198
- Nn,
6501
+ ),
6502
+ userData.email && !userData.emailVerified && /* @__PURE__ */ jsx(
6503
+ Nn,
6504
+ {
6505
+ variant: "secondary",
6506
+ fullWidth: true,
6507
+ onClick: () => {
6508
+ setShowVerificationDialog({
6509
+ isOpen: true,
6510
+ email: userData.email || "",
6511
+ id: userData.uid || ""
6512
+ });
6513
+ },
6514
+ children: "Resend Verification Email"
6515
+ }
6516
+ )
6517
+ ] })
6518
+ ]
6519
+ }
6520
+ ),
6521
+ /* @__PURE__ */ jsx(R, { marginTop: 5, marginBottom: 5 }),
6522
+ userData.localUser && /* @__PURE__ */ jsx(
6523
+ R,
6524
+ {
6525
+ as: "aside",
6526
+ background: "neutral0",
6527
+ borderColor: "neutral150",
6528
+ hasRadius: true,
6529
+ paddingBottom: 1,
6530
+ paddingLeft: 2,
6531
+ paddingRight: 2,
6532
+ paddingTop: 1,
6533
+ shadow: "tableShadow",
6534
+ children: /* @__PURE__ */ jsxs(R, { paddingTop: 2, paddingBottom: 2, children: [
6535
+ /* @__PURE__ */ jsx(DetailsButtonWrapper, { children: /* @__PURE__ */ jsx(
6536
+ zc,
6199
6537
  {
6200
- variant: "secondary",
6201
- fullWidth: true,
6202
- onClick: () => {
6203
- setShowVerificationDialog({
6204
- isOpen: true,
6205
- email: userData.email || "",
6206
- id: userData.uid || ""
6207
- });
6208
- },
6209
- children: "Resend Verification Email"
6538
+ startIcon: /* @__PURE__ */ jsx(_3, {}),
6539
+ onClick: () => navigate(
6540
+ `/content-manager/collection-types/plugin::users-permissions.user/${userData.localUser?.id}`
6541
+ ),
6542
+ style: { cursor: "pointer" },
6543
+ children: "Details"
6210
6544
  }
6211
- )
6545
+ ) }),
6546
+ /* @__PURE__ */ jsxs(ContentWrapper, { children: [
6547
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "local user:" }),
6548
+ /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: userData.localUser.username })
6549
+ ] })
6212
6550
  ] })
6213
- ]
6214
- }
6215
- ),
6216
- /* @__PURE__ */ jsx(R, { marginTop: 5, marginBottom: 5 }),
6217
- userData.localUser && /* @__PURE__ */ jsx(
6218
- R,
6551
+ }
6552
+ )
6553
+ ] }),
6554
+ children: /* @__PURE__ */ jsx(
6555
+ UserFormFields,
6219
6556
  {
6220
- as: "aside",
6221
- background: "neutral0",
6222
- borderColor: "neutral150",
6223
- hasRadius: true,
6224
- paddingBottom: 1,
6225
- paddingLeft: 2,
6226
- paddingRight: 2,
6227
- paddingTop: 1,
6228
- shadow: "tableShadow",
6229
- children: /* @__PURE__ */ jsxs(R, { paddingTop: 2, paddingBottom: 2, children: [
6230
- /* @__PURE__ */ jsx(DetailsButtonWrapper, { children: /* @__PURE__ */ jsx(
6231
- zc,
6232
- {
6233
- startIcon: /* @__PURE__ */ jsx(_3, {}),
6234
- onClick: () => navigate(
6235
- `/content-manager/collection-types/plugin::users-permissions.user/${userData.localUser?.id}`
6236
- ),
6237
- style: { cursor: "pointer" },
6238
- children: "Details"
6239
- }
6240
- ) }),
6241
- /* @__PURE__ */ jsxs(ContentWrapper, { children: [
6242
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: "local user:" }),
6243
- /* @__PURE__ */ jsx(E, { variant: "sigma", textColor: "neutral600", children: userData.localUser.username })
6244
- ] })
6245
- ] })
6557
+ userData,
6558
+ onTextInputChange: handlers.onTextInputChange,
6559
+ onPhoneChange: handlers.onPhoneChange,
6560
+ onToggleInputChange: handlers.onToggleInputChange,
6561
+ onEmailBlur: handlers.onEmailBlur,
6562
+ emailError,
6563
+ phoneError,
6564
+ showPasswordHint: true,
6565
+ hasBeenTouched: true
6246
6566
  }
6247
6567
  )
6248
- ] }),
6249
- children: /* @__PURE__ */ jsx(
6250
- UserFormFields,
6251
- {
6252
- userData,
6253
- onTextInputChange: handlers.onTextInputChange,
6254
- onPhoneChange: handlers.onPhoneChange,
6255
- onToggleInputChange: handlers.onToggleInputChange,
6256
- onEmailBlur: handlers.onEmailBlur,
6257
- emailError,
6258
- phoneError,
6259
- showPasswordHint: true,
6260
- hasBeenTouched: true
6261
- }
6262
- )
6263
- }
6264
- ) }),
6568
+ }
6569
+ ),
6570
+ /* @__PURE__ */ jsx(R, { marginTop: 6, children: /* @__PURE__ */ jsx(
6571
+ R,
6572
+ {
6573
+ background: "neutral0",
6574
+ borderColor: "neutral150",
6575
+ hasRadius: true,
6576
+ paddingBottom: 4,
6577
+ paddingLeft: 4,
6578
+ paddingRight: 4,
6579
+ paddingTop: 4,
6580
+ shadow: "tableShadow",
6581
+ children: /* @__PURE__ */ jsx(ActivityLog, { firebaseUserId: userData.uid || userData.firebaseUserID || "" })
6582
+ }
6583
+ ) })
6584
+ ] }),
6265
6585
  /* @__PURE__ */ jsx(
6266
6586
  ResetPassword,
6267
6587
  {