Skip to content

Commit 7495fef

Browse files
committed
Added manual authentication
1 parent 6959022 commit 7495fef

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

component_config/configSchema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
"daily_load": {
2929
"type": "boolean",
3030
"title": "Daily load"
31+
},
32+
"manual_authentication": {
33+
"type": "boolean",
34+
"title": "Manual Authentication"
3135
}
3236
}
3337
}

src/component.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
KEY_CLIENT_SECRET = '#client_secret'
1919
ENDPOINTS = 'endpoint'
2020
DAILY = 'daily_load'
21+
AUTHENTICATION = 'manual_authentication'
2122

2223
CODE_URL = "https://allegro.pl/auth/oauth/device"
2324
TOKEN_URL = "https://allegro.pl/auth/oauth/token"
@@ -57,9 +58,10 @@ def run(self):
5758
self.client_secret = params.get(KEY_CLIENT_SECRET)
5859
self.endpoint = params.get(ENDPOINTS)
5960
self.daily = params.get(DAILY)
61+
self.authentication = params.get(AUTHENTICATION)
6062

6163
previous_state = self.get_state_file()
62-
if previous_state.get('#refresh_token') is None:
64+
if self.authentication:
6365
code = self._get_code()
6466
result = json.loads(code.text)
6567
logging.info('Manual loggin needed for initial run.')

0 commit comments

Comments
 (0)