@strapi-community/plugin-better-auth-dashboard 1.0.0-alpha.4 → 1.0.0-alpha.6
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/admin/{Root-B1LuKMEv.mjs → Root-BHQUxF7-.mjs} +14 -10
- package/dist/admin/{Root-7EredGQZ.js → Root-BgL9lcCN.js} +14 -10
- package/dist/admin/{index-QVlTR8eL.mjs → index-DS5B1Klk.mjs} +1 -1
- package/dist/admin/{index-CIxfFlzU.js → index-DY_8hwEC.js} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { dashClient } from "@better-auth/infra/client";
|
|
|
7
7
|
import { createAuthClient, InferPlugin } from "better-auth/client";
|
|
8
8
|
import { Cross, Images, Trash, Plus, Pencil } from "@strapi/icons";
|
|
9
9
|
import { useNotification, useFetchClient } from "@strapi/strapi/admin";
|
|
10
|
-
import { g as getMediaLibraryComponent, P as PluginIcon } from "./index-
|
|
10
|
+
import { g as getMediaLibraryComponent, P as PluginIcon } from "./index-DS5B1Klk.mjs";
|
|
11
11
|
const dashPathMethods = () => ({
|
|
12
12
|
id: "dash-path-methods",
|
|
13
13
|
pathMethods: {
|
|
@@ -1115,7 +1115,7 @@ function OrganizationDetail({
|
|
|
1115
1115
|
};
|
|
1116
1116
|
const org = orgQuery.data;
|
|
1117
1117
|
const extraData = {
|
|
1118
|
-
...
|
|
1118
|
+
...strapiOrgQuery.data ?? {},
|
|
1119
1119
|
...editExtra
|
|
1120
1120
|
};
|
|
1121
1121
|
const updateOrgMutation = useMutation({
|
|
@@ -1132,7 +1132,10 @@ function OrganizationDetail({
|
|
|
1132
1132
|
body
|
|
1133
1133
|
);
|
|
1134
1134
|
},
|
|
1135
|
-
onSuccess: () => {
|
|
1135
|
+
onSuccess: async () => {
|
|
1136
|
+
await qc.invalidateQueries({
|
|
1137
|
+
queryKey: ["dash-strapi-org", organizationId]
|
|
1138
|
+
});
|
|
1136
1139
|
qc.invalidateQueries({ queryKey: ["dash-org", organizationId] });
|
|
1137
1140
|
qc.invalidateQueries({ queryKey: ["dash-organizations"] });
|
|
1138
1141
|
setEditName(void 0);
|
|
@@ -3282,7 +3285,7 @@ function OverviewPage() {
|
|
|
3282
3285
|
queryKey: ["dash-recent-sessions"],
|
|
3283
3286
|
queryFn: async () => {
|
|
3284
3287
|
const { data } = await get(
|
|
3285
|
-
"/better-auth-dashboard/db?uid=plugin::better-auth.session&pagination[pageSize]=12&sort[0]=
|
|
3288
|
+
"/better-auth-dashboard/db?uid=plugin::better-auth.session&pagination[pageSize]=12&sort[0]=updatedAt:desc"
|
|
3286
3289
|
);
|
|
3287
3290
|
return data.results ?? [];
|
|
3288
3291
|
},
|
|
@@ -3302,9 +3305,10 @@ function OverviewPage() {
|
|
|
3302
3305
|
const activeUserIds = [];
|
|
3303
3306
|
const lastActiveByUserId = /* @__PURE__ */ new Map();
|
|
3304
3307
|
for (const s of sessionsRaw) {
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
+
const uid = String(s.userId);
|
|
3309
|
+
if (!lastActiveByUserId.has(uid)) {
|
|
3310
|
+
lastActiveByUserId.set(uid, s.updatedAt ?? s.createdAt);
|
|
3311
|
+
activeUserIds.push(uid);
|
|
3308
3312
|
}
|
|
3309
3313
|
}
|
|
3310
3314
|
const activeUsersQuery = useQuery({
|
|
@@ -4068,10 +4072,10 @@ function UserDetailDrawer({
|
|
|
4068
4072
|
body
|
|
4069
4073
|
);
|
|
4070
4074
|
},
|
|
4071
|
-
onSuccess: () => {
|
|
4075
|
+
onSuccess: async () => {
|
|
4076
|
+
await qc.invalidateQueries({ queryKey: ["dash-strapi-user", userId] });
|
|
4072
4077
|
qc.invalidateQueries({ queryKey: ["dash-user", userId] });
|
|
4073
4078
|
qc.invalidateQueries({ queryKey: ["dash-users"] });
|
|
4074
|
-
qc.invalidateQueries({ queryKey: ["dash-strapi-user", userId] });
|
|
4075
4079
|
setEditName(void 0);
|
|
4076
4080
|
setEditEmail(void 0);
|
|
4077
4081
|
setEditEmailVerified(void 0);
|
|
@@ -4094,7 +4098,7 @@ function UserDetailDrawer({
|
|
|
4094
4098
|
mutationFn: async (sessionId) => {
|
|
4095
4099
|
const result = await client.dash.sessions.revoke(
|
|
4096
4100
|
{},
|
|
4097
|
-
withContext({ sessionId })
|
|
4101
|
+
withContext({ sessionId, userId })
|
|
4098
4102
|
);
|
|
4099
4103
|
if (result.error)
|
|
4100
4104
|
throw new Error(result.error.message ?? "Revoke failed");
|
|
@@ -9,7 +9,7 @@ const client$2 = require("@better-auth/infra/client");
|
|
|
9
9
|
const client$1 = require("better-auth/client");
|
|
10
10
|
const icons = require("@strapi/icons");
|
|
11
11
|
const admin = require("@strapi/strapi/admin");
|
|
12
|
-
const index = require("./index-
|
|
12
|
+
const index = require("./index-DY_8hwEC.js");
|
|
13
13
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
14
14
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
15
15
|
const dashPathMethods = () => ({
|
|
@@ -1119,7 +1119,7 @@ function OrganizationDetail({
|
|
|
1119
1119
|
};
|
|
1120
1120
|
const org = orgQuery.data;
|
|
1121
1121
|
const extraData = {
|
|
1122
|
-
...
|
|
1122
|
+
...strapiOrgQuery.data ?? {},
|
|
1123
1123
|
...editExtra
|
|
1124
1124
|
};
|
|
1125
1125
|
const updateOrgMutation = reactQuery.useMutation({
|
|
@@ -1136,7 +1136,10 @@ function OrganizationDetail({
|
|
|
1136
1136
|
body
|
|
1137
1137
|
);
|
|
1138
1138
|
},
|
|
1139
|
-
onSuccess: () => {
|
|
1139
|
+
onSuccess: async () => {
|
|
1140
|
+
await qc.invalidateQueries({
|
|
1141
|
+
queryKey: ["dash-strapi-org", organizationId]
|
|
1142
|
+
});
|
|
1140
1143
|
qc.invalidateQueries({ queryKey: ["dash-org", organizationId] });
|
|
1141
1144
|
qc.invalidateQueries({ queryKey: ["dash-organizations"] });
|
|
1142
1145
|
setEditName(void 0);
|
|
@@ -3286,7 +3289,7 @@ function OverviewPage() {
|
|
|
3286
3289
|
queryKey: ["dash-recent-sessions"],
|
|
3287
3290
|
queryFn: async () => {
|
|
3288
3291
|
const { data } = await get(
|
|
3289
|
-
"/better-auth-dashboard/db?uid=plugin::better-auth.session&pagination[pageSize]=12&sort[0]=
|
|
3292
|
+
"/better-auth-dashboard/db?uid=plugin::better-auth.session&pagination[pageSize]=12&sort[0]=updatedAt:desc"
|
|
3290
3293
|
);
|
|
3291
3294
|
return data.results ?? [];
|
|
3292
3295
|
},
|
|
@@ -3306,9 +3309,10 @@ function OverviewPage() {
|
|
|
3306
3309
|
const activeUserIds = [];
|
|
3307
3310
|
const lastActiveByUserId = /* @__PURE__ */ new Map();
|
|
3308
3311
|
for (const s of sessionsRaw) {
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
+
const uid = String(s.userId);
|
|
3313
|
+
if (!lastActiveByUserId.has(uid)) {
|
|
3314
|
+
lastActiveByUserId.set(uid, s.updatedAt ?? s.createdAt);
|
|
3315
|
+
activeUserIds.push(uid);
|
|
3312
3316
|
}
|
|
3313
3317
|
}
|
|
3314
3318
|
const activeUsersQuery = reactQuery.useQuery({
|
|
@@ -4072,10 +4076,10 @@ function UserDetailDrawer({
|
|
|
4072
4076
|
body
|
|
4073
4077
|
);
|
|
4074
4078
|
},
|
|
4075
|
-
onSuccess: () => {
|
|
4079
|
+
onSuccess: async () => {
|
|
4080
|
+
await qc.invalidateQueries({ queryKey: ["dash-strapi-user", userId] });
|
|
4076
4081
|
qc.invalidateQueries({ queryKey: ["dash-user", userId] });
|
|
4077
4082
|
qc.invalidateQueries({ queryKey: ["dash-users"] });
|
|
4078
|
-
qc.invalidateQueries({ queryKey: ["dash-strapi-user", userId] });
|
|
4079
4083
|
setEditName(void 0);
|
|
4080
4084
|
setEditEmail(void 0);
|
|
4081
4085
|
setEditEmailVerified(void 0);
|
|
@@ -4098,7 +4102,7 @@ function UserDetailDrawer({
|
|
|
4098
4102
|
mutationFn: async (sessionId) => {
|
|
4099
4103
|
const result = await client.dash.sessions.revoke(
|
|
4100
4104
|
{},
|
|
4101
|
-
withContext({ sessionId })
|
|
4105
|
+
withContext({ sessionId, userId })
|
|
4102
4106
|
);
|
|
4103
4107
|
if (result.error)
|
|
4104
4108
|
throw new Error(result.error.message ?? "Revoke failed");
|
|
@@ -55,7 +55,7 @@ const index = {
|
|
|
55
55
|
id: `${PLUGIN_ID}.plugin.name`,
|
|
56
56
|
defaultMessage: "Auth Dashboard"
|
|
57
57
|
},
|
|
58
|
-
Component: async () => Promise.resolve().then(() => require("./Root-
|
|
58
|
+
Component: async () => Promise.resolve().then(() => require("./Root-BgL9lcCN.js"))
|
|
59
59
|
});
|
|
60
60
|
},
|
|
61
61
|
bootstrap() {
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED