mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-23 23:28:18 +02:00
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:
1 parent
a78d648c01
commit
1d46228fac
4 files changed
+60
-9
No files matched your search
@@ -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!);
|
||||
|
||||
Reference in new issue
Block a user