@frigear-nu/users 3.1.1 → 3.1.2
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/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, addComponent, addServerImportsDir, hasNuxtModule, addPlugin } from '@nuxt/kit';
|
|
2
2
|
import { registerTailwindSource, registerLocales, registerDatabaseTable, registerSearchIndex, inlineModuleRuntime, addModulePages, addModuleRoutes, resolvePagePath, addOptionalMenuSource } from '@frigear-nu/module-kit/utils';
|
|
3
3
|
import { setAuthUserStore, registerAccess } from '@frigear-nu/auth/utils';
|
|
4
|
+
import { resolveAuthMode } from '@frigear-nu/auth/mode';
|
|
4
5
|
import { setNotifyRecipientStore } from '@frigear-nu/notify/utils';
|
|
5
6
|
import { usersAccess, USERS_SELF_SERVICE } from '../dist/runtime/access.js';
|
|
6
7
|
|
|
@@ -45,6 +46,10 @@ const module$1 = defineNuxtModule({
|
|
|
45
46
|
registerTailwindSource(nuxt, resolver.resolve("./runtime/app"));
|
|
46
47
|
registerLocales(nuxt, resolver.resolve("./runtime/i18n/lang"));
|
|
47
48
|
const settings = options.settings ?? {};
|
|
49
|
+
const signInHere = resolveAuthMode(nuxt) !== "resource";
|
|
50
|
+
if (!signInHere && settings.verifyEmailChange) {
|
|
51
|
+
console.warn("[@frigear-nu/users] `settings.verifyEmailChange` does nothing with `authentication.mode: 'resource'`: the email address changes at the issuer.");
|
|
52
|
+
}
|
|
48
53
|
addComponent({ name: "UserPicker", filePath: resolver.resolve("./runtime/app/components/UserPicker.vue") });
|
|
49
54
|
registerDatabaseTable(nuxt, {
|
|
50
55
|
resolver,
|
|
@@ -58,11 +63,15 @@ const module$1 = defineNuxtModule({
|
|
|
58
63
|
inlineModuleRuntime(nuxt, resolver);
|
|
59
64
|
const selfRoutes = [
|
|
60
65
|
{ method: "patch", path: "me", file: "me/profile.patch" },
|
|
61
|
-
{ method: "put", path: "me/locale", file: "me/locale.put" }
|
|
62
|
-
{ method: "put", path: "me/email", file: "me/email.put" },
|
|
63
|
-
{ method: "put", path: "me/password", file: "me/password.put" }
|
|
66
|
+
{ method: "put", path: "me/locale", file: "me/locale.put" }
|
|
64
67
|
];
|
|
65
|
-
if (
|
|
68
|
+
if (signInHere) {
|
|
69
|
+
selfRoutes.push(
|
|
70
|
+
{ method: "put", path: "me/email", file: "me/email.put" },
|
|
71
|
+
{ method: "put", path: "me/password", file: "me/password.put" }
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
if (signInHere && settings.verifyEmailChange) {
|
|
66
75
|
selfRoutes.push(
|
|
67
76
|
{ method: "get", path: "email-change", file: "me/email-change.get" },
|
|
68
77
|
{ method: "post", path: "email-change/confirm", file: "me/email-change-confirm.post" },
|
|
@@ -114,7 +123,7 @@ const module$1 = defineNuxtModule({
|
|
|
114
123
|
{ method: "get", path: ":id", file: "admin/user.get" },
|
|
115
124
|
{ method: "patch", path: ":id", file: "admin/user.patch" },
|
|
116
125
|
{ method: "delete", path: ":id", file: "admin/user.delete" },
|
|
117
|
-
{ method: "post", path: ":id/resend", file: "admin/user-resend.post" }
|
|
126
|
+
...signInHere ? [{ method: "post", path: ":id/resend", file: "admin/user-resend.post" }] : []
|
|
118
127
|
], { base: "/api/admin/users" });
|
|
119
128
|
if (adminPagePath) {
|
|
120
129
|
addModulePages("@frigear-nu/users", resolver, [
|
|
@@ -49,7 +49,7 @@ export function useUserActions() {
|
|
|
49
49
|
if (options.open !== false) {
|
|
50
50
|
first.push({ label: t("admin.open", "Open"), icon: "i-lucide-arrow-right", to: userPath(user.id) });
|
|
51
51
|
}
|
|
52
|
-
if (canUpdate) {
|
|
52
|
+
if (canUpdate && useRuntimeConfig().public.authentication?.mode !== "resource") {
|
|
53
53
|
first.push({
|
|
54
54
|
label: user.emailVerifiedAt ? t("admin.resendLink", "Resend sign-in link") : t("admin.sendVerification", "Resend verification email"),
|
|
55
55
|
icon: "i-lucide-mail",
|
|
@@ -34,7 +34,7 @@ export default defineEventHandler(async (event) => {
|
|
|
34
34
|
if (!user) {
|
|
35
35
|
throw apiError(500, "internal_error", "Failed to create the user.");
|
|
36
36
|
}
|
|
37
|
-
if (input.sendWelcomeEmail) {
|
|
37
|
+
if (input.sendWelcomeEmail && useRuntimeConfig(event).public.authentication?.mode !== "resource") {
|
|
38
38
|
await sendVerificationLink(event, user, { invite: true });
|
|
39
39
|
}
|
|
40
40
|
return created(event, toAdminUserDto(user, { pii: await allows(event, usersAccess.permissions.pii) }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frigear-nu/users",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "The user entity for the main frigear app: the users table, admin user management and self-service profile, email and password changes. Sign-in lives in @frigear-nu/auth.",
|
|
5
5
|
"homepage": "https://docs.frigear.dev/modules/identity/users",
|
|
6
6
|
"repository": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"playground"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@frigear-nu/auth": "^0.6.
|
|
37
|
+
"@frigear-nu/auth": "^0.6.4",
|
|
38
38
|
"@frigear-nu/mcp": "^0.5.0",
|
|
39
|
-
"@frigear-nu/module-kit": "^1.3.
|
|
39
|
+
"@frigear-nu/module-kit": "^1.3.7",
|
|
40
40
|
"@frigear-nu/notify": "^0.2.6",
|
|
41
41
|
"@frigear-nu/ui": "^0.2.7",
|
|
42
42
|
"@libsql/client": "^0.18.0",
|