Fix: Resolve API token truncation issue by returning the full token to the frontend

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/556e1d47-97f0-4035-8b49-f7a6d1863400.jpg
This commit is contained in:
alphaeusmote
2025-04-11 18:42:36 +00:00
parent 40bb4e3673
commit 25327896fb
+4 -14
View File
@@ -1141,13 +1141,8 @@ export async function registerRoutes(app: Express): Promise<Server> {
return res.status(404).json({ message: "API token not found" });
}
// Mask token in response
const maskedToken = {
...updatedToken,
token: updatedToken.token.substring(0, 8) + '...'
};
res.json(maskedToken);
// Return the full token in response (frontend will handle masking for display)
res.json(updatedToken);
} catch (error) {
if (error instanceof z.ZodError) {
res.status(400).json({ message: "Validation error", errors: error.errors });
@@ -1191,13 +1186,8 @@ export async function registerRoutes(app: Express): Promise<Server> {
return res.status(404).json({ message: "API token not found" });
}
// Mask token in response
const maskedToken = {
...updatedToken,
token: "*".repeat(16) // Use asterisks for token masking
};
res.json(maskedToken);
// Return the full token in response (frontend will handle masking for display)
res.json(updatedToken);
} catch (error) {
if (error instanceof z.ZodError) {
res.status(400).json({ message: "Validation error", errors: error.errors });