nuxt-users 1.38.0 → 1.40.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 +13 -1
- package/dist/cli.mjs +57 -27
- package/dist/module.d.mts +2 -2
- package/dist/module.d.ts +2 -2
- package/dist/module.json +4 -1
- package/dist/module.mjs +29 -7
- package/dist/runtime/assets/nuxt-users.css +1 -1
- package/dist/runtime/components/NUsersEmailConfirmation.d.vue.ts +5 -3
- package/dist/runtime/components/NUsersEmailConfirmation.vue +22 -15
- package/dist/runtime/components/NUsersEmailConfirmation.vue.d.ts +5 -3
- package/dist/runtime/components/NUsersGoogleLoginButton.d.vue.ts +4 -2
- package/dist/runtime/components/NUsersGoogleLoginButton.vue +5 -2
- package/dist/runtime/components/NUsersGoogleLoginButton.vue.d.ts +4 -2
- package/dist/runtime/components/NUsersList.vue +25 -11
- package/dist/runtime/components/NUsersLoginForm.d.vue.ts +13 -2
- package/dist/runtime/components/NUsersLoginForm.vue +35 -13
- package/dist/runtime/components/NUsersLoginForm.vue.d.ts +13 -2
- package/dist/runtime/components/NUsersLogoutLink.d.vue.ts +3 -4
- package/dist/runtime/components/NUsersLogoutLink.vue +8 -5
- package/dist/runtime/components/NUsersLogoutLink.vue.d.ts +3 -4
- package/dist/runtime/components/NUsersPasswordStrengthIndicator.d.vue.ts +6 -0
- package/dist/runtime/components/NUsersPasswordStrengthIndicator.vue +17 -9
- package/dist/runtime/components/NUsersPasswordStrengthIndicator.vue.d.ts +6 -0
- package/dist/runtime/components/NUsersProfileInfo.d.vue.ts +13 -1
- package/dist/runtime/components/NUsersProfileInfo.vue +23 -9
- package/dist/runtime/components/NUsersProfileInfo.vue.d.ts +13 -1
- package/dist/runtime/components/NUsersRegisterForm.d.vue.ts +26 -11
- package/dist/runtime/components/NUsersRegisterForm.vue +34 -16
- package/dist/runtime/components/NUsersRegisterForm.vue.d.ts +26 -11
- package/dist/runtime/components/NUsersResetPasswordForm.d.vue.ts +11 -2
- package/dist/runtime/components/NUsersResetPasswordForm.vue +25 -12
- package/dist/runtime/components/NUsersResetPasswordForm.vue.d.ts +11 -2
- package/dist/runtime/components/NUsersUserCard.d.vue.ts +2 -0
- package/dist/runtime/components/NUsersUserCard.vue +8 -4
- package/dist/runtime/components/NUsersUserCard.vue.d.ts +2 -0
- package/dist/runtime/components/NUsersUserForm.d.vue.ts +2 -2
- package/dist/runtime/components/NUsersUserForm.vue +5 -4
- package/dist/runtime/components/NUsersUserForm.vue.d.ts +2 -2
- package/dist/runtime/composables/useAuthentication.js +14 -0
- package/dist/runtime/composables/useNuxtUsersLocale.d.ts +15 -0
- package/dist/runtime/composables/useNuxtUsersLocale.js +27 -0
- package/dist/runtime/composables/usePasswordValidation.d.ts +1 -1
- package/dist/runtime/composables/usePublicPaths.js +2 -1
- package/dist/runtime/locales/en.d.ts +2 -0
- package/dist/runtime/locales/en.js +130 -0
- package/dist/runtime/locales/hu.d.ts +3 -0
- package/dist/runtime/locales/hu.js +188 -0
- package/dist/runtime/locales/index.d.ts +5 -0
- package/dist/runtime/locales/index.js +8 -0
- package/dist/runtime/server/api/nuxt-users/[id].delete.js +1 -1
- package/dist/runtime/server/api/nuxt-users/[id].get.js +1 -1
- package/dist/runtime/server/api/nuxt-users/[id].patch.js +1 -1
- package/dist/runtime/server/api/nuxt-users/auth/google/callback.get.js +1 -1
- package/dist/runtime/server/api/nuxt-users/auth/google/redirect.get.js +1 -1
- package/dist/runtime/server/api/nuxt-users/confirm-email.get.js +3 -3
- package/dist/runtime/server/api/nuxt-users/inactive.get.js +1 -2
- package/dist/runtime/server/api/nuxt-users/index.get.js +1 -2
- package/dist/runtime/server/api/nuxt-users/index.post.js +1 -1
- package/dist/runtime/server/api/nuxt-users/me.get.js +20 -13
- package/dist/runtime/server/api/nuxt-users/me.patch.js +1 -1
- package/dist/runtime/server/api/nuxt-users/password/forgot.post.js +2 -1
- package/dist/runtime/server/api/nuxt-users/password/index.patch.js +1 -1
- package/dist/runtime/server/api/nuxt-users/password/reset.post.d.ts +1 -1
- package/dist/runtime/server/api/nuxt-users/password/reset.post.js +4 -2
- package/dist/runtime/server/api/nuxt-users/session/index.delete.js +1 -1
- package/dist/runtime/server/api/nuxt-users/session/index.post.js +5 -3
- package/dist/runtime/server/composables/useServerAuth.js +1 -1
- package/dist/runtime/server/internal/index.d.ts +1 -7
- package/dist/runtime/server/internal/index.js +23 -7
- package/dist/runtime/server/middleware/authorization.server.js +22 -5
- package/dist/runtime/server/tasks/cleanup-tokens.d.ts +1 -1
- package/dist/runtime/server/utils/add-indexes.d.ts +3 -0
- package/dist/runtime/server/utils/add-indexes.js +17 -0
- package/dist/runtime/server/utils/google-oauth.js +2 -1
- package/dist/runtime/server/utils/index.d.ts +2 -2
- package/dist/runtime/server/utils/index.js +2 -2
- package/dist/runtime/server/utils/migrate.d.ts +6 -0
- package/dist/runtime/server/utils/migrate.js +10 -1
- package/dist/runtime/utils/deep-merge.d.ts +8 -0
- package/dist/runtime/utils/deep-merge.js +17 -0
- package/dist/runtime/utils/locale.d.ts +14 -0
- package/dist/runtime/utils/locale.js +38 -0
- package/dist/shared/{nuxt-users.BnOQs2LI.mjs → nuxt-users.DfZ7bc_P.mjs} +16 -8
- package/dist/shared/{nuxt-users.SXaMnaEL.d.mts → nuxt-users.XW6DYM7t.d.mts} +46 -2
- package/dist/shared/{nuxt-users.SXaMnaEL.d.ts → nuxt-users.XW6DYM7t.d.ts} +46 -2
- package/dist/utils.d.mts +4 -1
- package/dist/utils.d.ts +4 -1
- package/dist/utils.mjs +4 -1
- package/package.json +11 -6
- package/scripts/check-locale-consistency.ts +156 -0
- package/scripts/check-peer-dependencies.js +5 -5
- package/scripts/check-translations.ts +255 -0
- package/scripts/post-build.js +1 -1
- package/scripts/test-nuxt3.sh +78 -0
|
@@ -50,7 +50,8 @@ export const usePublicPaths = () => {
|
|
|
50
50
|
rolePermissions.forEach((permission) => {
|
|
51
51
|
if (typeof permission === "string") {
|
|
52
52
|
roleBasedPaths.push(permission);
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
|
+
if (typeof permission === "object" && permission.path) {
|
|
54
55
|
roleBasedPaths.push(permission.path);
|
|
55
56
|
}
|
|
56
57
|
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export const en = {
|
|
2
|
+
common: {
|
|
3
|
+
email: "Email",
|
|
4
|
+
password: "Password",
|
|
5
|
+
name: "Name",
|
|
6
|
+
fullName: "Full Name",
|
|
7
|
+
role: "Role",
|
|
8
|
+
active: "Active",
|
|
9
|
+
yes: "Yes",
|
|
10
|
+
no: "No",
|
|
11
|
+
id: "ID",
|
|
12
|
+
created: "Created",
|
|
13
|
+
updated: "Updated",
|
|
14
|
+
lastLogin: "Last Login",
|
|
15
|
+
registered: "Registered",
|
|
16
|
+
lastUpdated: "Last updated",
|
|
17
|
+
edit: "Edit",
|
|
18
|
+
delete: "Delete",
|
|
19
|
+
loading: "Loading...",
|
|
20
|
+
error: "Error"
|
|
21
|
+
},
|
|
22
|
+
login: {
|
|
23
|
+
title: "Welcome Back",
|
|
24
|
+
subtitle: "Sign in to your account",
|
|
25
|
+
emailPlaceholder: "Enter your email",
|
|
26
|
+
passwordLabel: "Password",
|
|
27
|
+
passwordPlaceholder: "Enter your password",
|
|
28
|
+
rememberMe: "Remember me",
|
|
29
|
+
submit: "Sign In",
|
|
30
|
+
submitting: "Signing in...",
|
|
31
|
+
forgotPassword: "Forgot your password?",
|
|
32
|
+
forgotPasswordSending: "Sending...",
|
|
33
|
+
emailRequiredForForgotPassword: "Please enter your email address first",
|
|
34
|
+
loginFailed: "Login failed",
|
|
35
|
+
forgotPasswordFailed: "Failed to send password reset email"
|
|
36
|
+
},
|
|
37
|
+
register: {
|
|
38
|
+
title: "Create Account",
|
|
39
|
+
subtitle: "Sign up for a new account",
|
|
40
|
+
nameLabel: "Full Name",
|
|
41
|
+
namePlaceholder: "Enter your full name",
|
|
42
|
+
emailPlaceholder: "Enter your email",
|
|
43
|
+
passwordLabel: "Password",
|
|
44
|
+
passwordPlaceholder: "Enter your password",
|
|
45
|
+
confirmPasswordLabel: "Confirm Password",
|
|
46
|
+
confirmPasswordPlaceholder: "Confirm your password",
|
|
47
|
+
passwordMismatch: "Passwords do not match",
|
|
48
|
+
submit: "Create Account",
|
|
49
|
+
submitting: "Creating Account...",
|
|
50
|
+
alreadyHaveAccount: "Already have an account?",
|
|
51
|
+
signInLink: "Sign in here"
|
|
52
|
+
},
|
|
53
|
+
resetPassword: {
|
|
54
|
+
titleReset: "Reset Password",
|
|
55
|
+
titleChange: "Change Password",
|
|
56
|
+
currentPasswordLabel: "Current Password",
|
|
57
|
+
newPasswordLabel: "New Password",
|
|
58
|
+
confirmPasswordLabel: "Confirm New Password",
|
|
59
|
+
submitReset: "Reset Password",
|
|
60
|
+
submitUpdate: "Update Password",
|
|
61
|
+
submittingReset: "Resetting...",
|
|
62
|
+
submittingUpdate: "Updating...",
|
|
63
|
+
passwordHelpText: "Password must contain at least",
|
|
64
|
+
secureResetInfo: "You are resetting your password using a secure link."
|
|
65
|
+
},
|
|
66
|
+
passwordStrength: {
|
|
67
|
+
label: "Password Requirements",
|
|
68
|
+
strength: {
|
|
69
|
+
weak: "Weak",
|
|
70
|
+
medium: "Medium",
|
|
71
|
+
strong: "Strong",
|
|
72
|
+
veryStrong: "Very Strong",
|
|
73
|
+
unknown: "Unknown"
|
|
74
|
+
},
|
|
75
|
+
requirements: {
|
|
76
|
+
minLength: "At least {0} characters",
|
|
77
|
+
uppercase: "Contains uppercase letter",
|
|
78
|
+
lowercase: "Contains lowercase letter",
|
|
79
|
+
numbers: "Contains number",
|
|
80
|
+
specialChars: "Contains special character"
|
|
81
|
+
},
|
|
82
|
+
hintsTitle: "How to make your password stronger?"
|
|
83
|
+
},
|
|
84
|
+
profile: {
|
|
85
|
+
title: "Profile Information",
|
|
86
|
+
name: "Name",
|
|
87
|
+
email: "Email",
|
|
88
|
+
role: "Role",
|
|
89
|
+
registered: "Registered",
|
|
90
|
+
lastUpdated: "Last updated",
|
|
91
|
+
active: "Active",
|
|
92
|
+
id: "ID"
|
|
93
|
+
},
|
|
94
|
+
emailConfirmation: {
|
|
95
|
+
successTitle: "Email Confirmed!",
|
|
96
|
+
errorTitle: "Confirmation Failed",
|
|
97
|
+
loginButton: "Continue to Login",
|
|
98
|
+
backToLogin: "Back to Login",
|
|
99
|
+
processing: "Processing...",
|
|
100
|
+
processingMessage: "Please wait while we process your email confirmation.",
|
|
101
|
+
successMessage: "Your email has been confirmed and your account is now active.",
|
|
102
|
+
errorMessage: "The confirmation link is invalid or has expired. Please try registering again or contact support."
|
|
103
|
+
},
|
|
104
|
+
logout: {
|
|
105
|
+
linkText: "Logout",
|
|
106
|
+
loggingOut: "Logging out...",
|
|
107
|
+
confirmMessage: "Are you sure you want to logout?"
|
|
108
|
+
},
|
|
109
|
+
userCard: {
|
|
110
|
+
edit: "Edit",
|
|
111
|
+
delete: "Delete",
|
|
112
|
+
deleteConfirm: "Are you sure you want to delete user {0}?"
|
|
113
|
+
},
|
|
114
|
+
googleLogin: {
|
|
115
|
+
buttonText: "Continue with Google",
|
|
116
|
+
redirecting: "Redirecting..."
|
|
117
|
+
},
|
|
118
|
+
usersList: {
|
|
119
|
+
title: "Users List",
|
|
120
|
+
loading: "Loading users...",
|
|
121
|
+
noUsers: "No users found",
|
|
122
|
+
error: "Error",
|
|
123
|
+
page: "Page",
|
|
124
|
+
of: "of",
|
|
125
|
+
total: "Total",
|
|
126
|
+
users: "users",
|
|
127
|
+
previous: "Previous",
|
|
128
|
+
next: "Next"
|
|
129
|
+
}
|
|
130
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { deepMerge } from "../utils/deep-merge.js";
|
|
2
|
+
const huBase = {
|
|
3
|
+
common: {
|
|
4
|
+
email: "E-mail",
|
|
5
|
+
password: "Jelsz\xF3",
|
|
6
|
+
name: "N\xE9v",
|
|
7
|
+
fullName: "Teljes n\xE9v",
|
|
8
|
+
role: "Szerepk\xF6r",
|
|
9
|
+
active: "Akt\xEDv",
|
|
10
|
+
yes: "Igen",
|
|
11
|
+
no: "Nem",
|
|
12
|
+
id: "ID",
|
|
13
|
+
created: "L\xE9trehozva",
|
|
14
|
+
updated: "Friss\xEDtve",
|
|
15
|
+
lastLogin: "Utols\xF3 bel\xE9p\xE9s",
|
|
16
|
+
registered: "Regisztr\xE1lva",
|
|
17
|
+
lastUpdated: "Utolj\xE1ra friss\xEDtve",
|
|
18
|
+
edit: "Szerkeszt\xE9s",
|
|
19
|
+
delete: "T\xF6rl\xE9s",
|
|
20
|
+
loading: "Bet\xF6lt\xE9s...",
|
|
21
|
+
error: "Hiba"
|
|
22
|
+
},
|
|
23
|
+
login: {
|
|
24
|
+
passwordLabel: "Jelsz\xF3",
|
|
25
|
+
submit: "Bejelentkez\xE9s",
|
|
26
|
+
submitting: "Bejelentkez\xE9s...",
|
|
27
|
+
forgotPasswordSending: "K\xFCld\xE9s...",
|
|
28
|
+
loginFailed: "Bejelentkez\xE9s sikertelen",
|
|
29
|
+
forgotPasswordFailed: "A jelsz\xF3 vissza\xE1ll\xEDt\xF3 e-mail k\xFCld\xE9se sikertelen"
|
|
30
|
+
},
|
|
31
|
+
register: {
|
|
32
|
+
title: "Regisztr\xE1ci\xF3",
|
|
33
|
+
nameLabel: "Teljes n\xE9v",
|
|
34
|
+
passwordLabel: "Jelsz\xF3",
|
|
35
|
+
confirmPasswordLabel: "Jelsz\xF3 meger\u0151s\xEDt\xE9s",
|
|
36
|
+
passwordMismatch: "A jelszavak nem egyeznek",
|
|
37
|
+
submit: "Regisztr\xE1ci\xF3",
|
|
38
|
+
submitting: "Fi\xF3k l\xE9trehoz\xE1sa..."
|
|
39
|
+
},
|
|
40
|
+
resetPassword: {
|
|
41
|
+
titleReset: "Jelsz\xF3 vissza\xE1ll\xEDt\xE1s",
|
|
42
|
+
titleChange: "Jelsz\xF3 megv\xE1ltoztat\xE1sa",
|
|
43
|
+
currentPasswordLabel: "Jelenlegi jelsz\xF3",
|
|
44
|
+
newPasswordLabel: "\xDAj jelsz\xF3",
|
|
45
|
+
confirmPasswordLabel: "\xDAj jelsz\xF3 meger\u0151s\xEDt\xE9se",
|
|
46
|
+
submitReset: "Jelsz\xF3 vissza\xE1ll\xEDt\xE1s",
|
|
47
|
+
submitUpdate: "Jelsz\xF3 friss\xEDt\xE9se",
|
|
48
|
+
submittingReset: "Vissza\xE1ll\xEDt\xE1s...",
|
|
49
|
+
submittingUpdate: "Friss\xEDt\xE9s...",
|
|
50
|
+
passwordHelpText: "A jelsz\xF3nak tartalmaznia kell legal\xE1bb",
|
|
51
|
+
secureResetInfo: "Biztons\xE1gos linket haszn\xE1lva \xE1ll\xEDthatod vissza a jelszavad."
|
|
52
|
+
},
|
|
53
|
+
passwordStrength: {
|
|
54
|
+
label: "Jelsz\xF3 k\xF6vetelm\xE9nyek",
|
|
55
|
+
strength: {
|
|
56
|
+
weak: "Gyenge",
|
|
57
|
+
medium: "K\xF6zepes",
|
|
58
|
+
strong: "Er\u0151s",
|
|
59
|
+
veryStrong: "Nagyon er\u0151s",
|
|
60
|
+
unknown: "Ismeretlen"
|
|
61
|
+
},
|
|
62
|
+
requirements: {
|
|
63
|
+
minLength: "Legal\xE1bb {0} karakter",
|
|
64
|
+
uppercase: "Tartalmaz nagybet\u0171t",
|
|
65
|
+
lowercase: "Tartalmaz kisbet\u0171t",
|
|
66
|
+
numbers: "Tartalmaz sz\xE1mot",
|
|
67
|
+
specialChars: "Tartalmaz speci\xE1lis karaktert"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
profile: {
|
|
71
|
+
title: "Profil inform\xE1ci\xF3k",
|
|
72
|
+
name: "N\xE9v",
|
|
73
|
+
email: "E-mail",
|
|
74
|
+
role: "Jogosults\xE1g",
|
|
75
|
+
registered: "Regisztr\xE1lva",
|
|
76
|
+
lastUpdated: "Utolj\xE1ra friss\xEDtve",
|
|
77
|
+
active: "Akt\xEDv",
|
|
78
|
+
id: "ID"
|
|
79
|
+
},
|
|
80
|
+
emailConfirmation: {
|
|
81
|
+
successTitle: "E-mail meger\u0151s\xEDtve!",
|
|
82
|
+
errorTitle: "Meger\u0151s\xEDt\xE9s sikertelen",
|
|
83
|
+
loginButton: "Tov\xE1bb a bejelentkez\xE9shez",
|
|
84
|
+
backToLogin: "Vissza a bejelentkez\xE9shez",
|
|
85
|
+
processing: "Feldolgoz\xE1s..."
|
|
86
|
+
},
|
|
87
|
+
logout: {
|
|
88
|
+
linkText: "Kijelentkez\xE9s",
|
|
89
|
+
loggingOut: "Kijelentkez\xE9s...",
|
|
90
|
+
confirmMessage: "Biztosan ki szeretn\xE9l jelentkezni?"
|
|
91
|
+
},
|
|
92
|
+
userCard: {
|
|
93
|
+
edit: "Szerkeszt\xE9s",
|
|
94
|
+
delete: "T\xF6rl\xE9s"
|
|
95
|
+
},
|
|
96
|
+
googleLogin: {
|
|
97
|
+
buttonText: "Folytat\xE1s Google-lel",
|
|
98
|
+
redirecting: "\xC1tir\xE1ny\xEDt\xE1s..."
|
|
99
|
+
},
|
|
100
|
+
usersList: {
|
|
101
|
+
title: "Felhaszn\xE1l\xF3k list\xE1ja",
|
|
102
|
+
loading: "Felhaszn\xE1l\xF3k bet\xF6lt\xE9se...",
|
|
103
|
+
noUsers: "Nem tal\xE1lhat\xF3 felhaszn\xE1l\xF3",
|
|
104
|
+
error: "Hiba",
|
|
105
|
+
page: "Oldal",
|
|
106
|
+
of: "/",
|
|
107
|
+
total: "\xD6sszesen",
|
|
108
|
+
users: "felhaszn\xE1l\xF3",
|
|
109
|
+
previous: "El\u0151z\u0151",
|
|
110
|
+
next: "K\xF6vetkez\u0151"
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const huInformalOverrides = {
|
|
114
|
+
login: {
|
|
115
|
+
title: "Hell\xF3!",
|
|
116
|
+
subtitle: "Jelentkezz be a fi\xF3kodba",
|
|
117
|
+
emailPlaceholder: "Add meg az e-mail c\xEDmed",
|
|
118
|
+
passwordPlaceholder: "Add meg a jelszavad",
|
|
119
|
+
forgotPassword: "Elfelejtetted a jelszavad?",
|
|
120
|
+
rememberMe: "Eml\xE9kezz r\xE1m",
|
|
121
|
+
emailRequiredForForgotPassword: "K\xE9rj\xFCk, el\u0151sz\xF6r add meg az e-mail c\xEDmed",
|
|
122
|
+
loginFailed: "Bejelentkez\xE9s sikertelen",
|
|
123
|
+
forgotPasswordFailed: "A jelsz\xF3 vissza\xE1ll\xEDt\xF3 e-mail k\xFCld\xE9se sikertelen"
|
|
124
|
+
},
|
|
125
|
+
register: {
|
|
126
|
+
subtitle: "Hozz l\xE9tre egy \xFAj fi\xF3kot",
|
|
127
|
+
namePlaceholder: "Add meg a teljes neved",
|
|
128
|
+
emailPlaceholder: "Add meg az e-mail c\xEDmed",
|
|
129
|
+
passwordPlaceholder: "Add meg a jelszavad",
|
|
130
|
+
confirmPasswordPlaceholder: "Er\u0151s\xEDtsd meg a jelszavad",
|
|
131
|
+
alreadyHaveAccount: "M\xE1r van fi\xF3kod?",
|
|
132
|
+
signInLink: "Jelentkezz be itt",
|
|
133
|
+
submit: "Regisztr\xE1lj"
|
|
134
|
+
},
|
|
135
|
+
passwordStrength: {
|
|
136
|
+
hintsTitle: "Hogyan tedd er\u0151sebb\xE9 a jelszavad"
|
|
137
|
+
},
|
|
138
|
+
logout: {
|
|
139
|
+
confirmMessage: "Biztosan ki szeretn\xE9l jelentkezni?"
|
|
140
|
+
},
|
|
141
|
+
userCard: {
|
|
142
|
+
deleteConfirm: "Biztosan t\xF6rl\xF6d {0} felhaszn\xE1l\xF3t?"
|
|
143
|
+
},
|
|
144
|
+
emailConfirmation: {
|
|
145
|
+
processingMessage: "K\xE9rj\xFCk, v\xE1rj, am\xEDg feldolgozzuk az e-mail meger\u0151s\xEDt\xE9s\xE9t.",
|
|
146
|
+
successMessage: "Az e-mail c\xEDmed meger\u0151s\xEDt\xE9sre ker\xFClt \xE9s a fi\xF3kod akt\xEDv.",
|
|
147
|
+
errorMessage: "A meger\u0151s\xEDt\u0151 link \xE9rv\xE9nytelen vagy lej\xE1rt. K\xE9rj\xFCk, pr\xF3b\xE1ld \xFAjra regisztr\xE1lni vagy l\xE9pj kapcsolatba az \xFCgyf\xE9lszolg\xE1lattal."
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const huFormalOverrides = {
|
|
151
|
+
login: {
|
|
152
|
+
title: "\xDCdv\xF6z\xF6lj\xFCk",
|
|
153
|
+
subtitle: "Jelentkezzen be fi\xF3kj\xE1ba",
|
|
154
|
+
emailPlaceholder: "Adja meg az e-mail c\xEDm\xE9t",
|
|
155
|
+
passwordPlaceholder: "Adja meg a jelszav\xE1t",
|
|
156
|
+
forgotPassword: "Elfelejtette a jelszav\xE1t?",
|
|
157
|
+
rememberMe: "Bejelentkezve maradok",
|
|
158
|
+
emailRequiredForForgotPassword: "K\xE9rj\xFCk, el\u0151sz\xF6r adja meg az e-mail c\xEDm\xE9t",
|
|
159
|
+
loginFailed: "Bejelentkez\xE9s sikertelen",
|
|
160
|
+
forgotPasswordFailed: "A jelsz\xF3 vissza\xE1ll\xEDt\xF3 e-mail k\xFCld\xE9se sikertelen"
|
|
161
|
+
},
|
|
162
|
+
register: {
|
|
163
|
+
subtitle: "Hozzon l\xE9tre egy \xFAj fi\xF3kot",
|
|
164
|
+
namePlaceholder: "Adja meg a teljes nev\xE9t",
|
|
165
|
+
emailPlaceholder: "Adja meg az e-mail c\xEDm\xE9t",
|
|
166
|
+
passwordPlaceholder: "Adja meg a jelszav\xE1t",
|
|
167
|
+
confirmPasswordPlaceholder: "Er\u0151s\xEDtse meg a jelszav\xE1t",
|
|
168
|
+
alreadyHaveAccount: "M\xE1r van fi\xF3kja?",
|
|
169
|
+
signInLink: "Jelentkezzen be itt",
|
|
170
|
+
submit: "Regisztr\xE1ljon"
|
|
171
|
+
},
|
|
172
|
+
passwordStrength: {
|
|
173
|
+
hintsTitle: "Hogyan tegye er\u0151sebb\xE9 a jelszav\xE1t?"
|
|
174
|
+
},
|
|
175
|
+
logout: {
|
|
176
|
+
confirmMessage: "Biztosan ki szeretne jelentkezni?"
|
|
177
|
+
},
|
|
178
|
+
userCard: {
|
|
179
|
+
deleteConfirm: "Biztosan t\xF6rli {0} felhaszn\xE1l\xF3t?"
|
|
180
|
+
},
|
|
181
|
+
emailConfirmation: {
|
|
182
|
+
processingMessage: "K\xE9rj\xFCk, v\xE1rjon, am\xEDg feldolgozzuk az e-mail meger\u0151s\xEDt\xE9s\xE9t.",
|
|
183
|
+
successMessage: "Az e-mail c\xEDme meger\u0151s\xEDt\xE9sre ker\xFClt \xE9s a fi\xF3kja akt\xEDv.",
|
|
184
|
+
errorMessage: "A meger\u0151s\xEDt\u0151 link \xE9rv\xE9nytelen vagy lej\xE1rt. K\xE9rj\xFCk, pr\xF3b\xE1ljon meg \xFAjra regisztr\xE1lni vagy l\xE9pjen kapcsolatba az \xFCgyf\xE9lszolg\xE1lattal."
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
export const hu = deepMerge(huBase, huInformalOverrides);
|
|
188
|
+
export const huFormal = deepMerge(huBase, huFormalOverrides);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { deleteUser } from "../../utils/
|
|
3
|
+
import { deleteUser } from "../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
6
6
|
const options = nuxtUsers;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { findUserById } from "../../utils/
|
|
3
|
+
import { findUserById } from "../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
6
6
|
const options = nuxtUsers;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler, readBody } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { updateUser } from "../../utils/
|
|
3
|
+
import { updateUser } from "../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
6
6
|
const options = nuxtUsers;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getGoogleUserFromCode,
|
|
6
6
|
findOrCreateGoogleUser,
|
|
7
7
|
createAuthTokenForUser
|
|
8
|
-
} from "../../../../utils/
|
|
8
|
+
} from "../../../../utils/index.js";
|
|
9
9
|
export default defineEventHandler(async (event) => {
|
|
10
10
|
const { nuxtUsers } = useRuntimeConfig();
|
|
11
11
|
const options = nuxtUsers;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler, sendRedirect, createError } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { createGoogleOAuth2Client, getGoogleAuthUrl } from "../../../../utils/
|
|
3
|
+
import { createGoogleOAuth2Client, getGoogleAuthUrl } from "../../../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
6
6
|
const options = nuxtUsers;
|
|
@@ -20,7 +20,8 @@ export default defineEventHandler(async (event) => {
|
|
|
20
20
|
redirectUrl.searchParams.set("status", "success");
|
|
21
21
|
redirectUrl.searchParams.set("message", "Email confirmed successfully! Your account is now active. You can now log in.");
|
|
22
22
|
return sendRedirect(event, redirectUrl.pathname + redirectUrl.search, 302);
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
|
+
if (!success) {
|
|
24
25
|
const redirectUrl = new URL(options.emailConfirmationUrl, "http://localhost");
|
|
25
26
|
redirectUrl.searchParams.set("status", "error");
|
|
26
27
|
redirectUrl.searchParams.set("message", "Invalid or expired confirmation token");
|
|
@@ -32,10 +33,9 @@ export default defineEventHandler(async (event) => {
|
|
|
32
33
|
const options = nuxtUsers;
|
|
33
34
|
const redirectUrl = new URL(options.emailConfirmationUrl, "http://localhost");
|
|
34
35
|
redirectUrl.searchParams.set("status", "error");
|
|
36
|
+
redirectUrl.searchParams.set("message", "Email confirmation failed");
|
|
35
37
|
if (error instanceof Error) {
|
|
36
38
|
redirectUrl.searchParams.set("message", error.message);
|
|
37
|
-
} else {
|
|
38
|
-
redirectUrl.searchParams.set("message", "Email confirmation failed");
|
|
39
39
|
}
|
|
40
40
|
return sendRedirect(event, redirectUrl.pathname + redirectUrl.search, 302);
|
|
41
41
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler, getQuery } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { useDb } from "../../utils/
|
|
4
|
-
import { getLastLoginTime } from "../../utils/user.js";
|
|
3
|
+
import { useDb, getLastLoginTime } from "../../utils/index.js";
|
|
5
4
|
export default defineEventHandler(async (event) => {
|
|
6
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
7
6
|
const options = nuxtUsers;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler, getQuery } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { useDb } from "../../utils/
|
|
4
|
-
import { getLastLoginTime } from "../../utils/user.js";
|
|
3
|
+
import { useDb, getLastLoginTime } from "../../utils/index.js";
|
|
5
4
|
export default defineEventHandler(async (event) => {
|
|
6
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
7
6
|
const options = nuxtUsers;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler, readBody } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { createUser } from "../../utils/
|
|
3
|
+
import { createUser } from "../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
6
6
|
const options = nuxtUsers;
|
|
@@ -2,21 +2,28 @@ import { createError, defineEventHandler, getCookie } from "h3";
|
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
3
|
import { getCurrentUserFromToken } from "../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const token = getCookie(event, "auth_token");
|
|
8
|
-
if (!token) {
|
|
9
|
-
throw createError({
|
|
10
|
-
statusCode: 401,
|
|
11
|
-
statusMessage: "Unauthorized - No authentication token found"
|
|
12
|
-
});
|
|
5
|
+
if (!event.context) {
|
|
6
|
+
event.context = {};
|
|
13
7
|
}
|
|
14
|
-
|
|
8
|
+
let user = event.context.nuxtUsers?.user;
|
|
15
9
|
if (!user) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
const token = getCookie(event, "auth_token");
|
|
11
|
+
if (!token) {
|
|
12
|
+
throw createError({
|
|
13
|
+
statusCode: 401,
|
|
14
|
+
statusMessage: "Unauthorized - No authentication token found"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const { nuxtUsers } = useRuntimeConfig();
|
|
18
|
+
const options = nuxtUsers;
|
|
19
|
+
const validatedUser = await getCurrentUserFromToken(token, options);
|
|
20
|
+
if (!validatedUser) {
|
|
21
|
+
throw createError({
|
|
22
|
+
statusCode: 401,
|
|
23
|
+
statusMessage: "Unauthorized - Invalid authentication token"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
user = validatedUser;
|
|
20
27
|
}
|
|
21
28
|
return { user };
|
|
22
29
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler, readBody } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { updateUser } from "../../utils/
|
|
3
|
+
import { updateUser } from "../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
6
6
|
const options = nuxtUsers;
|
|
@@ -21,7 +21,8 @@ export default defineEventHandler(async (event) => {
|
|
|
21
21
|
} catch (error) {
|
|
22
22
|
if (error instanceof Error) {
|
|
23
23
|
console.error("[Nuxt Users] Error in forgot-password endpoint:", error.message);
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
|
+
if (!(error instanceof Error)) {
|
|
25
26
|
console.error("[Nuxt Users] Error in forgot-password endpoint:", error);
|
|
26
27
|
}
|
|
27
28
|
throw createError({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createError, defineEventHandler, getCookie, readBody } from "h3";
|
|
2
2
|
import bcrypt from "bcrypt";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
|
-
import { getCurrentUserFromToken, updateUserPassword } from "../../../utils/
|
|
4
|
+
import { getCurrentUserFromToken, updateUserPassword } from "../../../utils/index.js";
|
|
5
5
|
import { validatePassword, getPasswordValidationOptions } from "../../../../../utils";
|
|
6
6
|
export default defineEventHandler(async (event) => {
|
|
7
7
|
const { nuxtUsers } = useRuntimeConfig();
|
|
@@ -27,7 +27,8 @@ export default defineEventHandler(async (event) => {
|
|
|
27
27
|
const success = await resetPassword(token, email, password, options);
|
|
28
28
|
if (success) {
|
|
29
29
|
return { message: "Password has been reset successfully. You can now log in with your new password." };
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
|
+
if (!success) {
|
|
31
32
|
throw createError({
|
|
32
33
|
statusCode: 400,
|
|
33
34
|
// Or 422 if you prefer for semantic validation errors
|
|
@@ -37,7 +38,8 @@ export default defineEventHandler(async (event) => {
|
|
|
37
38
|
} catch (error) {
|
|
38
39
|
if (error instanceof Error) {
|
|
39
40
|
console.error("[Nuxt Users] Error in reset-password endpoint:", error.message);
|
|
40
|
-
}
|
|
41
|
+
}
|
|
42
|
+
if (!(error instanceof Error)) {
|
|
41
43
|
console.error("[Nuxt Users] Error in reset-password endpoint:", error);
|
|
42
44
|
}
|
|
43
45
|
if (error instanceof H3Error) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler, getCookie, setCookie } from "h3";
|
|
2
2
|
import { useRuntimeConfig } from "#imports";
|
|
3
|
-
import { useDb } from "../../../utils/
|
|
3
|
+
import { useDb } from "../../../utils/index.js";
|
|
4
4
|
export default defineEventHandler(async (event) => {
|
|
5
5
|
const { nuxtUsers } = useRuntimeConfig();
|
|
6
6
|
const options = nuxtUsers;
|
|
@@ -2,7 +2,7 @@ import { createError, defineEventHandler, readBody, setCookie } from "h3";
|
|
|
2
2
|
import bcrypt from "bcrypt";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import { useRuntimeConfig } from "#imports";
|
|
5
|
-
import { useDb } from "../../../utils/
|
|
5
|
+
import { useDb } from "../../../utils/index.js";
|
|
6
6
|
export default defineEventHandler(async (event) => {
|
|
7
7
|
const body = await readBody(event);
|
|
8
8
|
const { email, password, rememberMe } = body;
|
|
@@ -51,7 +51,8 @@ export default defineEventHandler(async (event) => {
|
|
|
51
51
|
if (rememberMe) {
|
|
52
52
|
const longTermDays = options.auth.rememberMeExpiration || 30;
|
|
53
53
|
expiresAt.setDate(expiresAt.getDate() + longTermDays);
|
|
54
|
-
}
|
|
54
|
+
}
|
|
55
|
+
if (!rememberMe) {
|
|
55
56
|
expiresAt.setMinutes(expiresAt.getMinutes() + options.auth.tokenExpiration);
|
|
56
57
|
}
|
|
57
58
|
await db.sql`
|
|
@@ -69,7 +70,8 @@ export default defineEventHandler(async (event) => {
|
|
|
69
70
|
if (rememberMe) {
|
|
70
71
|
const longTermDays = options.auth.rememberMeExpiration || 30;
|
|
71
72
|
cookieOptions.maxAge = 60 * 60 * 24 * longTermDays;
|
|
72
|
-
}
|
|
73
|
+
}
|
|
74
|
+
if (!rememberMe) {
|
|
73
75
|
}
|
|
74
76
|
setCookie(event, "auth_token", token, cookieOptions);
|
|
75
77
|
const { password: _, ...userWithoutPassword } = user;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export { useDb, checkTableExists } from '../utils/
|
|
2
|
-
export { createUser, findUserByEmail, updateUserPassword, getCurrentUserFromToken, hasAnyUsers, deleteExpiredPersonalAccessTokens, deleteTokensWithoutExpiration, cleanupPersonalAccessTokens, revokeUserTokens, getLastLoginTime } from '../utils/user.js';
|
|
3
|
-
export { createUsersTable } from '../utils/create-users-table.js';
|
|
4
|
-
export { createPersonalAccessTokensTable } from '../utils/create-personal-access-tokens-table.js';
|
|
5
|
-
export { createPasswordResetTokensTable } from '../utils/create-password-reset-tokens-table.js';
|
|
6
|
-
export { createMigrationsTable } from '../utils/create-migrations-table.js';
|
|
7
|
-
export { runMigrations } from '../utils/migrate.js';
|
|
1
|
+
export { useDb, checkTableExists, createUser, findUserByEmail, updateUserPassword, getCurrentUserFromToken, hasAnyUsers, deleteExpiredPersonalAccessTokens, deleteTokensWithoutExpiration, cleanupPersonalAccessTokens, revokeUserTokens, getLastLoginTime, findUserById, updateUser, deleteUser, createUsersTable, createPersonalAccessTokensTable, createPasswordResetTokensTable, createMigrationsTable, runMigrations, getAppliedMigrations } from '../utils/index.js';
|
|
8
2
|
export { useNuxtUsersDatabase } from '../composables/useNuxtUsersDatabase.js';
|
|
9
3
|
export { useServerAuth } from '../composables/useServerAuth.js';
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export {
|
|
2
|
+
useDb,
|
|
3
|
+
checkTableExists,
|
|
4
|
+
createUser,
|
|
5
|
+
findUserByEmail,
|
|
6
|
+
updateUserPassword,
|
|
7
|
+
getCurrentUserFromToken,
|
|
8
|
+
hasAnyUsers,
|
|
9
|
+
deleteExpiredPersonalAccessTokens,
|
|
10
|
+
deleteTokensWithoutExpiration,
|
|
11
|
+
cleanupPersonalAccessTokens,
|
|
12
|
+
revokeUserTokens,
|
|
13
|
+
getLastLoginTime,
|
|
14
|
+
findUserById,
|
|
15
|
+
updateUser,
|
|
16
|
+
deleteUser,
|
|
17
|
+
createUsersTable,
|
|
18
|
+
createPersonalAccessTokensTable,
|
|
19
|
+
createPasswordResetTokensTable,
|
|
20
|
+
createMigrationsTable,
|
|
21
|
+
runMigrations,
|
|
22
|
+
getAppliedMigrations
|
|
23
|
+
} from "../utils/index.js";
|
|
8
24
|
export { useNuxtUsersDatabase } from "../composables/useNuxtUsersDatabase.js";
|
|
9
25
|
export { useServerAuth } from "../composables/useServerAuth.js";
|