9
9
load_dotenv ()
10
10
11
11
#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" )
15
15
16
16
AUTH_URL = 'https://www.patreon.com/oauth2/authorize'
17
17
TOKEN_URL = 'https://www.patreon.com/api/oauth2/token'
18
18
IDENTITY_URL = 'https://www.patreon.com/api/oauth2/v2/identity'
19
19
20
20
21
21
22
-
23
22
def get_user_data (session ):
24
23
"""Fetch user data and campaign ID from the Patreon API, including non-members."""
25
24
access_token = session .get ('access_token' )
@@ -262,22 +261,20 @@ def get(session):
262
261
if user_data :
263
262
# User is logged in; show profile and logout buttons
264
263
name = H4 (user_data ['data' ]['attributes' ]['full_name' ],cls = "card-title text-2xl" )
265
- email = user_data .get ('data' , {}).get ('attributes' , {}).get ('email' )
266
264
267
265
logout_button = A ("Logout" , href = "/logout" , cls = "btn btn-sm btn-secondary m-1" )
268
266
profile_image = Img (src = user_data ['data' ]['attributes' ]['thumb_url' ])
269
267
270
268
else :
271
269
# User is not logged in; show login button
272
270
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" )
274
271
logout_button = Div () # Empty div to maintain layout consistency
275
272
profile_image = Img (src = "https://github.com/Anas099X/OpenSAT/blob/main/public/banner.png?raw=true" )
276
273
277
274
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 :
280
275
tier = "Free"
276
+ else :
277
+ tier = "OpenSAT+"
281
278
282
279
283
280
return (
@@ -302,7 +299,6 @@ def get(session):
302
299
Div (
303
300
Div (Div (profile_image ,cls = "w-20 rounded-full" ),cls = "avatar m-1" ),
304
301
name ,
305
- Div (f"Email: { email } " ,cls = "font-bold" ),
306
302
Div (f"Tier: { tier } " ,cls = "font-bold" ),
307
303
logout_button ,
308
304
cls = "card card-body bg-base-100 shadow-xl mx-auto p-10 mt-10" ,
0 commit comments