mirror of
https://github.com/BreizhHardware/Site-comptage-heure.git
synced 2026-05-09 08:15:31 +02:00
[PR #23] [MERGED] feat: Add bulk import from ISEN excel #81
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
BreizhHardware/Site-comptage-heure#81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/BreizhHardware/Site-comptage-heure/pull/23
Author: @BreizhHardware
Created: 11/20/2025
Status: ✅ Merged
Merged: 11/20/2025
Merged by: @BreizhHardware
Base:
dev← Head:feat/bulk-import📝 Commits (1)
eb8132bfeat: Add bulk import from ISEN excel📊 Changes
15 files changed (+1398 additions, -2018 deletions)
View changed files
📝
README.md(+2 -2)➕
app/admin/import-users/page.tsx(+213 -0)📝
app/admin/page.tsx(+6 -1)➕
app/api/change-password/route.ts(+35 -0)➕
app/api/import-users/route.ts(+170 -0)➕
app/change-password/page.tsx(+117 -0)📝
components/providers.tsx(+26 -2)📝
lib/auth.ts(+9 -1)📝
package.json(+2 -1)📝
pnpm-lock.yaml(+747 -2011)➕
prisma/migrations/20251120162836_add_password_reset_required/migration.sql(+33 -0)➕
prisma/migrations/migration_lock.toml(+3 -0)📝
prisma/schema.prisma(+2 -0)➕
scripts/fix-imported-passwords.js(+30 -0)📝
types/next-auth.d.ts(+3 -0)📄 Description
This pull request introduces a comprehensive user import workflow from Excel files, enforces password reset for newly imported users, and adds backend and frontend support for password changes. It also improves session management to ensure users with temporary passwords are redirected to change their password before accessing the app. Additional minor improvements include dependency updates and documentation tweaks.
User Import Feature:
app/admin/import-users/page.tsx) for uploading and parsing Excel files, previewing users to be imported, handling errors, and confirming import actions.app/api/import-users/route.ts) for parsing Excel files, validating user data, and batch creating users with temporary passwords andpasswordResetRequiredset totrue.app/admin/page.tsx) to include a button linking to the new import users page.Password Reset Enforcement:
passwordResetRequiredboolean field to theUsermodel in the database schema and migration.lib/auth.ts) to propagatepasswordResetRequiredthrough JWT tokens and session objects, supporting session updates after password changes. [1] [2]PasswordResetGuardin the global providers (components/providers.tsx) to redirect users with a temporary password to the password change page.Password Change Flow:
app/change-password/page.tsx) that enforces password requirements and updates the session state after a successful change.app/api/change-password/route.ts) to securely update the user's password and clear thepasswordResetRequiredflag.Other Improvements:
pnpxinstead ofnpxfor Prisma commands.rimrafpackage topackage.jsonand pins the Prisma version for improved dependency management.Closes #22
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.