improve token fetch
This commit is contained in:
@@ -8,7 +8,7 @@ WORKDIR /app
|
|||||||
COPY ./propedal-planner /app
|
COPY ./propedal-planner /app
|
||||||
|
|
||||||
# Install any needed packages specified in requirements.txt
|
# Install any needed packages specified in requirements.txt
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
# Make port available to the world outside this container
|
# Make port available to the world outside this container
|
||||||
EXPOSE 8001
|
EXPOSE 8001
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ except ImportError:
|
|||||||
from backports.zoneinfo import ZoneInfo
|
from backports.zoneinfo import ZoneInfo
|
||||||
|
|
||||||
WEEKDAYS= {0:"Mo", 1:"Di", 2:"Mi", 3:"Do", 4: "Fr", 5:"Sa", 6: "So"}
|
WEEKDAYS= {0:"Mo", 1:"Di", 2:"Mi", 3:"Do", 4: "Fr", 5:"Sa", 6: "So"}
|
||||||
|
result = None
|
||||||
|
|
||||||
# Optional logging
|
# Optional logging
|
||||||
|
|
||||||
# logging.getLogger("msal").setLevel(logging.INFO) # Optionally disable MSAL DEBUG logs
|
# logging.getLogger("msal").setLevel(logging.INFO) # Optionally disable MSAL DEBUG logs
|
||||||
@@ -27,10 +29,9 @@ app = msal.ConfidentialClientApplication(
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_access_token():
|
def get_access_token():
|
||||||
global app
|
global app, result
|
||||||
|
|
||||||
# The pattern to acquire a token looks like this.
|
# The pattern to acquire a token looks like this.
|
||||||
result = None
|
|
||||||
|
|
||||||
# Firstly, looks up a token from cache
|
# Firstly, looks up a token from cache
|
||||||
# Since we are looking for token for the current app, NOT for an end user,
|
# Since we are looking for token for the current app, NOT for an end user,
|
||||||
|
|||||||
Reference in New Issue
Block a user