This commit is contained in:
2025-07-18 11:33:13 +00:00
parent 596efa3f06
commit f530fa639a
14 changed files with 54 additions and 64 deletions

View File

@@ -1,7 +1,7 @@
import * as plugins from './bunq.plugins.js';
import { BunqHttpClient } from './bunq.classes.httpclient.js';
import { BunqCrypto } from './bunq.classes.crypto.js';
import {
import type {
IBunqApiContext,
IBunqInstallationResponse,
IBunqDeviceServerResponse,
@@ -39,7 +39,9 @@ export class BunqSession {
*/
private async createInstallation(): Promise<void> {
// Generate RSA key pair if not already generated
if (!this.crypto.getPublicKey()) {
try {
this.crypto.getPublicKey();
} catch (error) {
await this.crypto.generateKeyPair();
}
@@ -143,7 +145,7 @@ export class BunqSession {
}
const now = new plugins.smarttime.TimeStamp();
return this.sessionExpiryTime.isYoungerThanOtherTimeStamp(now);
return now.isOlderThan(this.sessionExpiryTime);
}
/**