Spaces:
Sleeping
Sleeping
Commit ·
0e3e8f3
1
Parent(s): 3da2efd
revert
Browse files- api/auth_routes.py +0 -1
- services/supabase_service.py +11 -3
api/auth_routes.py
CHANGED
|
@@ -101,6 +101,5 @@ async def get_current_user_info(current_user = Depends(get_current_user)):
|
|
| 101 |
return {
|
| 102 |
"jira_email": current_user.jira_email,
|
| 103 |
"jira_server_url": current_user.jira_server_url,
|
| 104 |
-
"jira_account_id": current_user.jira_account_id,
|
| 105 |
"authenticated": True
|
| 106 |
}
|
|
|
|
| 101 |
return {
|
| 102 |
"jira_email": current_user.jira_email,
|
| 103 |
"jira_server_url": current_user.jira_server_url,
|
|
|
|
| 104 |
"authenticated": True
|
| 105 |
}
|
services/supabase_service.py
CHANGED
|
@@ -23,16 +23,24 @@ class SupabaseService:
|
|
| 23 |
"""
|
| 24 |
Find user's firebase_id by email from the Users table
|
| 25 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
if not self.client:
|
| 27 |
logger.warning("Supabase client not initialized")
|
| 28 |
return None
|
| 29 |
|
| 30 |
try:
|
| 31 |
-
|
| 32 |
-
response = self.client.table("Users").select("firebase_id").eq("jira_email", email).execute()
|
| 33 |
|
| 34 |
if response.data and len(response.data) > 0:
|
| 35 |
-
return response.data[0]
|
| 36 |
return None
|
| 37 |
|
| 38 |
except Exception as e:
|
|
|
|
| 23 |
"""
|
| 24 |
Find user's firebase_id by email from the Users table
|
| 25 |
"""
|
| 26 |
+
user = self.get_user_by_email(email)
|
| 27 |
+
if user:
|
| 28 |
+
return user.get("firebase_id")
|
| 29 |
+
return None
|
| 30 |
+
|
| 31 |
+
def get_user_by_email(self, email: str) -> Optional[Dict[str, Any]]:
|
| 32 |
+
"""
|
| 33 |
+
Get full user details by email
|
| 34 |
+
"""
|
| 35 |
if not self.client:
|
| 36 |
logger.warning("Supabase client not initialized")
|
| 37 |
return None
|
| 38 |
|
| 39 |
try:
|
| 40 |
+
response = self.client.table("Users").select("*").eq("jira_email", email).execute()
|
|
|
|
| 41 |
|
| 42 |
if response.data and len(response.data) > 0:
|
| 43 |
+
return response.data[0]
|
| 44 |
return None
|
| 45 |
|
| 46 |
except Exception as e:
|