This repository was archived by the owner on Mar 21, 2021. It is now read-only.
File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ You can also provide your user and pass via environment variables:
32
32
33
33
``` javascript
34
34
// run as:
35
- // DEGIRO_USER=johndow DEGIRO_PASS=1234 node app.js
35
+ // DEGIRO_USER=johndoe DEGIRO_PASS=1234 node app.js
36
36
37
37
const DeGiro = require (' degiro' );
38
38
// now you don't need to provide your credentials
@@ -48,6 +48,15 @@ degiro.login().then(session => console.log(session));
48
48
// prints session info (session id and account number)
49
49
```
50
50
51
+ Two factor authentication is also supported. Pass the 2fa token through javascript or as an environment variable.
52
+
53
+ ``` javascript
54
+ const DeGiro = require (' degiro' );
55
+ // alternatively run as:
56
+ // DEGIRO_USER=johndoe DEGIRO_PASS=1234 DEGIRO_ONE_TIME_PASS=123456 node app.js
57
+ const degiro = DeGiro .create ({username: ' johndoe' , password: ' 1234' , oneTimePassword: ' 123456' });
58
+ ```
59
+
51
60
You can reuse your sessions if you provide the id and account number via environment variables (` DEGIRO_SID `
52
61
and ` DEGIRO_ACCOUNT ` ), direct assignment or constructor parameters.
53
62
Original file line number Diff line number Diff line change
1
+ const DeGiro = require ( '..' ) ;
2
+
3
+ // Set your username, password and oneTimePassword (google
4
+ // authenticator token) below or run from terminal as:
5
+ // DEGIRO_USER=username DEGIRO_PASS=password DEGIRO_ONE_TIME_PASS=token node examples/two-factor-login.js
6
+
7
+ const degiro = DeGiro . create ( {
8
+ // username: 'john',
9
+ // password: 'password',
10
+ // oneTimePassword: '123456'
11
+ } ) ;
12
+
13
+ degiro . login ( )
14
+ . then ( console . log )
15
+ . catch ( console . error ) ;
16
+
You can’t perform that action at this time.
0 commit comments