Commit a43640ca authored by Alp Deniz Ogut's avatar Alp Deniz Ogut
Browse files

Use callback_url from env. set default to demo page

parent 66948f30
Pipeline #14833 passed with stages
in 1 minute and 5 seconds
Showing with 6 additions and 3 deletions
+6 -3
......@@ -5,4 +5,7 @@ load_dotenv()
SERVICE_NAME = "flickr"
API_KEY = os.getenv("FLICKR_API_KEY")
SECRET_KEY = os.getenv("FLICKR_API_SECRET")
\ No newline at end of file
SECRET_KEY = os.getenv("FLICKR_API_SECRET")
# OAuth callback url
CALLBACK_URL = os.environ.get("CALLBACK_URL", 'https://d37rcpzq1f4qlq.cloudfront.net')
\ No newline at end of file
......@@ -19,7 +19,7 @@ from .data.schema import (
)
from time import time, sleep
from .service.flickr_api import FlickrService
from .config import SERVICE_NAME
from .config import SERVICE_NAME, CALLBACK_URL
from flickrapi.auth import FlickrAccessToken
from concurrent.futures import ThreadPoolExecutor
from urllib.parse import parse_qs
......@@ -92,7 +92,7 @@ class FlickrPlugin(PluginBase):
def auth(self):
oauth_flow = self.get_authentication_flow()
if not oauth_flow or not oauth_flow.accessToken or oauth_flow.status == 'fail':
url = self.flickr_service.get_oauth_url('http://localhost:1234')
url = self.flickr_service.get_oauth_url(CALLBACK_URL)
oauth_flow.authUrl = url
oauth_flow.status = 'await_user_action'
self.client.update_item(oauth_flow)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment