fix(oauth): fix OAuth token authentication flow for existing installations
This commit is contained in:
@@ -24,14 +24,16 @@ export class BunqSession {
|
||||
/**
|
||||
* Initialize a new bunq API session
|
||||
*/
|
||||
public async init(deviceDescription: string, permittedIps: string[] = []): Promise<void> {
|
||||
// Step 1: Installation
|
||||
await this.createInstallation();
|
||||
public async init(deviceDescription: string, permittedIps: string[] = [], skipInstallationAndDevice: boolean = false): Promise<void> {
|
||||
if (!skipInstallationAndDevice) {
|
||||
// Step 1: Installation
|
||||
await this.createInstallation();
|
||||
|
||||
// Step 2: Device registration
|
||||
await this.registerDevice(deviceDescription, permittedIps);
|
||||
}
|
||||
|
||||
// Step 2: Device registration
|
||||
await this.registerDevice(deviceDescription, permittedIps);
|
||||
|
||||
// Step 3: Session creation
|
||||
// Step 3: Session creation (always required)
|
||||
await this.createSession();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user