mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-22 07:26:39 +00:00
Fix: Improve error handling and logging for undefined values in registration.
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/616774c3-6728-4884-b1a3-da6f175f78f9.jpg
This commit is contained in:
+8
-1
@@ -505,15 +505,22 @@ export class MemStorage implements IStorage {
|
||||
// Handle expiresAt
|
||||
let expiresAt = null;
|
||||
if (token.expiresAt) {
|
||||
console.log("Processing expiresAt from token:", token.expiresAt);
|
||||
if (token.expiresAt instanceof Date) {
|
||||
expiresAt = token.expiresAt;
|
||||
console.log("expiresAt is a Date object:", expiresAt);
|
||||
} else if (typeof token.expiresAt === 'string') {
|
||||
try {
|
||||
expiresAt = new Date(token.expiresAt);
|
||||
console.log("Parsed expiresAt from string:", expiresAt);
|
||||
} catch (e) {
|
||||
console.error("Failed to parse expiresAt date string:", token.expiresAt);
|
||||
console.error("Failed to parse expiresAt date string:", token.expiresAt, e);
|
||||
}
|
||||
} else {
|
||||
console.error("Unexpected expiresAt type:", typeof token.expiresAt);
|
||||
}
|
||||
} else {
|
||||
console.log("No expiresAt provided in token data");
|
||||
}
|
||||
|
||||
const newToken: ApiToken = {
|
||||
|
||||
Reference in New Issue
Block a user