@adminforth/email-invite 1.0.4 → 1.0.5
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/build.log +2 -2
- package/custom/SetPassword.vue +1 -1
- package/dist/custom/SetPassword.vue +1 -1
- package/dist/index.js +3 -0
- package/index.ts +3 -1
- package/package.json +1 -1
package/build.log
CHANGED
package/custom/SetPassword.vue
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<!-- Modal body -->
|
|
38
38
|
<div class="p-4 md:p-5">
|
|
39
39
|
<!-- Success message -->
|
|
40
|
-
<div v-if="passwordSet" class="af-alert-success flex items-center justify-center p-4 mb-4 text-sm
|
|
40
|
+
<div v-if="passwordSet" class="af-alert-success flex items-center justify-center p-4 mb-4 text-sm rounded-lg dark:text-white" role="alert">
|
|
41
41
|
<div class="text-center">
|
|
42
42
|
<p class="mb-3">{{$t('Password set successfully!')}}</p>
|
|
43
43
|
<Link to="/login" class="inline-flex items-center px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<!-- Modal body -->
|
|
38
38
|
<div class="p-4 md:p-5">
|
|
39
39
|
<!-- Success message -->
|
|
40
|
-
<div v-if="passwordSet" class="af-alert-success flex items-center justify-center p-4 mb-4 text-sm
|
|
40
|
+
<div v-if="passwordSet" class="af-alert-success flex items-center justify-center p-4 mb-4 text-sm rounded-lg dark:text-white" role="alert">
|
|
41
41
|
<div class="text-center">
|
|
42
42
|
<p class="mb-3">{{$t('Password set successfully!')}}</p>
|
|
43
43
|
<Link to="/login" class="inline-flex items-center px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500">
|
package/dist/index.js
CHANGED
|
@@ -212,6 +212,9 @@ export default class EmailInvitePlugin extends AdminForthPlugin {
|
|
|
212
212
|
if (!userRecord) {
|
|
213
213
|
return { error: 'User not found', ok: false };
|
|
214
214
|
}
|
|
215
|
+
if (userRecord[this.options.emailConfirmedField]) {
|
|
216
|
+
return { error: 'Password already set. Invitation link cannot be reused.', ok: false };
|
|
217
|
+
}
|
|
215
218
|
const userEmail = userRecord[this.options.emailField];
|
|
216
219
|
const tokenEmail = email;
|
|
217
220
|
if (!userEmail || userEmail.toLowerCase() !== tokenEmail.toLowerCase()) {
|
package/index.ts
CHANGED
|
@@ -259,11 +259,13 @@ export default class EmailInvitePlugin extends AdminForthPlugin {
|
|
|
259
259
|
);
|
|
260
260
|
userRecord = records.length > 0 ? records[0] : null;
|
|
261
261
|
}
|
|
262
|
-
|
|
263
262
|
if (!userRecord) {
|
|
264
263
|
return { error: 'User not found', ok: false };
|
|
265
264
|
}
|
|
266
265
|
|
|
266
|
+
if ( userRecord[this.options.emailConfirmedField] ) {
|
|
267
|
+
return { error: 'Password already set. Invitation link cannot be reused.', ok: false };
|
|
268
|
+
}
|
|
267
269
|
const userEmail = userRecord[this.options.emailField];
|
|
268
270
|
const tokenEmail = email;
|
|
269
271
|
|