• Shuts down the callback server if it's running

    Safely terminates the HTTP server that was handling OAuth callbacks. This function is idempotent and can be safely called multiple times, even if the server is already closed or wasn't started.

    The server is automatically shut down after successful authentication, but this function can also be called manually to cancel the authentication process or clean up resources.

    Returns void

    // Close the server when canceling authentication
    shutdownServer();
    export function shutdownServer(): void {
    if (server) {
    server.close(() => {
    saveLog("OAuth callback server closed", "DEBUG");
    });
    server = null;
    }
    }