stage #4

Merged
ThaMunsta merged 4 commits from stage into main 2026-01-31 03:38:42 +00:00
2 changed files with 4 additions and 5 deletions
Showing only changes of commit 33026a6ecd - Show all commits

View File

@@ -50,12 +50,9 @@ router.post('/generate-reset-token', verifyToken, requireAdmin, asyncHandler(asy
[userId, token, req.user.userId, expiresAt]
);
// Generate reset URL
const resetUrl = `${process.env.FRONTEND_URL || 'http://localhost:5173'}/reset-password/${token}`;
res.json({
success: true,
resetUrl,
token,
user: {
id: user.id,
username: user.username,

View File

@@ -40,8 +40,10 @@ function Admin() {
const handleGenerateResetToken = async (userId) => {
try {
const data = await api.generateResetToken(userId);
// Build URL using current domain (works in dev and prod)
const resetUrl = `${window.location.origin}/reset-password/${data.token}`;
setGeneratedUrl({
url: data.resetUrl,
url: resetUrl,
user: data.user,
expiresAt: data.expiresAt
});