Skip to content

Commit

Permalink
Return access token from .env instead of user input
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno committed Oct 28, 2023
1 parent b36e612 commit 774308b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
.pytest_cache
classes/test.py
classes/test.py
.env
9 changes: 7 additions & 2 deletions classes/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# import .env file
from decouple import config

class Auth:
""" Authenticate with HubSpot """
def get_token():
# get HubSpot private app token from input
token = input('Enter your HubSpot private app token: ')
return token
# token = input('Enter your HubSpot private app token: ')
# return token from .env file
access_token = config('ACCESS_TOKEN')
return access_token
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest
pytest
python-decouple

0 comments on commit 774308b

Please sign in to comment.