Improve login page security by dynamically showing default credentials

Adds API endpoint to check default admin password status and hides credentials.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/22c32c18-bf03-4830-a5c9-ef4544d0e27f.jpg
This commit is contained in:
michaelschal committed 2025-07-09 19:31:54 +00:00
1 parent a78d648c01
commit 1d46228fac
4 files changed
+60 -9

No files matched your search

+11
View File
@@ -105,6 +105,17 @@ export async function registerRoutes(app: Express): Promise<Server> {
});
});
// Check if default admin credentials are still in use
app.get('/api/auth/default-credentials-status', async (req, res) => {
try {
const isUsingDefault = await storage.isUsingDefaultPassword();
res.json({ showDefaultCredentials: isUsingDefault });
} catch (error) {
console.error('Default credentials check error:', error);
res.status(500).json({ error: "Failed to check default credentials status" });
}
});
app.get('/api/auth/me', requireAuth, async (req, res) => {
try {
const user = await storage.getUser(req.session.userId!);