Skip to content

Commit 02dce89

Browse files
committed
fix: add password reuse check and update styling
1 parent 1f40f51 commit 02dce89

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

custom/SetPassword.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<!-- Modal body -->
3838
<div class="p-4 md:p-5">
3939
<!-- Success message -->
40-
<div v-if="passwordSet" class="af-alert-success flex items-center justify-center p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-50 dark:bg-green-800 dark:text-green-400" role="alert">
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">
4141
<div class="text-center">
4242
<p class="mb-3">{{$t('Password set successfully!')}}</p>
4343
<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">

index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,13 @@ export default class EmailInvitePlugin extends AdminForthPlugin {
259259
);
260260
userRecord = records.length > 0 ? records[0] : null;
261261
}
262-
263262
if (!userRecord) {
264263
return { error: 'User not found', ok: false };
265264
}
266265

266+
if ( userRecord[this.options.emailConfirmedField] ) {
267+
return { error: 'Password already set. Invitation link cannot be reused.', ok: false };
268+
}
267269
const userEmail = userRecord[this.options.emailField];
268270
const tokenEmail = email;
269271

0 commit comments

Comments
 (0)