fix(rgi): redirect to eTerra when server-side download unavailable
When fileVisibility returns OK → download server-side (fast). When not available → HTTP 302 redirect to eTerra direct URL. User's browser session handles authentication automatically. This means: if logged into eTerra in browser, ALL documents download. If not logged in, eTerra shows its own login page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -217,6 +217,14 @@ export class EterraClient {
|
||||
const cookies = await this.jar.getCookies(LOGIN_URL);
|
||||
if (!cookies.some((c) => c.key === "JSESSIONID"))
|
||||
throw new Error("Login failed / session not set");
|
||||
|
||||
// Activate RGI module context by loading the RGI page
|
||||
// This may set additional session attributes needed for document downloads
|
||||
try {
|
||||
await this.client.get(`${BASE_URL}/`, { timeout: 10_000 });
|
||||
} catch {
|
||||
// Non-critical
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- High-level parcels --------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user