Skip to content

Commit 5d5ae17

Browse files
committed
remove email displayment from /profile and added patreon stuff into env
1 parent 1767679 commit 5d5ae17

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

main.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@
99
load_dotenv()
1010

1111
#oauth
12-
CLIENT_ID = 'CTqlZU5Du7n2eA3yuZoRP3eOi9eqMrj89QmSZR9DuqMzVAd2cc90FC1DY_XtASv4'
13-
CLIENT_SECRET = '7BF-vtstFA7HjCrziAAXrCu3WSU7g81Izfem6tiBCxRIhYi9QcJxJN-kRSsPZDUk'
14-
REDIRECT_URI = 'https://opensat.fun/callback'
12+
CLIENT_ID = os.getenv("CLIENT_ID")
13+
CLIENT_SECRET = os.getenv("CLIENT_SECRET")
14+
REDIRECT_URI = os.getenv("REDIRECT_URI")
1515

1616
AUTH_URL = 'https://www.patreon.com/oauth2/authorize'
1717
TOKEN_URL = 'https://www.patreon.com/api/oauth2/token'
1818
IDENTITY_URL = 'https://www.patreon.com/api/oauth2/v2/identity'
1919

2020

2121

22-
2322
def get_user_data(session):
2423
"""Fetch user data and campaign ID from the Patreon API, including non-members."""
2524
access_token = session.get('access_token')
@@ -262,22 +261,20 @@ def get(session):
262261
if user_data:
263262
# User is logged in; show profile and logout buttons
264263
name = H4(user_data['data']['attributes']['full_name'],cls="card-title text-2xl")
265-
email = user_data.get('data', {}).get('attributes', {}).get('email')
266264

267265
logout_button = A("Logout", href="/logout", cls="btn btn-sm btn-secondary m-1")
268266
profile_image = Img(src=user_data['data']['attributes']['thumb_url'])
269267

270268
else:
271269
# User is not logged in; show login button
272270
name = A("Profile", href="/profile", cls="btn rounded-full btn-sm btn-primary m-1")
273-
email = A("Profile", href="/profile", cls="btn rounded-full btn-sm btn-primary m-1")
274271
logout_button = Div() # Empty div to maintain layout consistency
275272
profile_image = Img(src="https://github.com/Anas099X/OpenSAT/blob/main/public/banner.png?raw=true")
276273

277274
if camp_id != 7055998 and user_data.get('data', {}).get('attributes', {}).get('email') not in os.getenv("SPECIAL_ACCESS", "").split(","):
278-
tier = "OpenSAT+"
279-
else:
280275
tier = "Free"
276+
else:
277+
tier = "OpenSAT+"
281278

282279

283280
return (
@@ -302,7 +299,6 @@ def get(session):
302299
Div(
303300
Div(Div(profile_image,cls="w-20 rounded-full"),cls="avatar m-1"),
304301
name,
305-
Div(f"Email: {email}",cls="font-bold"),
306302
Div(f"Tier: {tier}",cls="font-bold"),
307303
logout_button,
308304
cls="card card-body bg-base-100 shadow-xl mx-auto p-10 mt-10",

0 commit comments

Comments
 (0)