Rudraaaa76 commited on
Commit
f397f69
·
1 Parent(s): 4073163

fixed issues

Browse files
Files changed (2) hide show
  1. api/auth_routes.py +5 -2
  2. main.py +6 -0
api/auth_routes.py CHANGED
@@ -53,13 +53,16 @@ async def login(credentials: LoginRequest):
53
  account_id = myself.get("accountId")
54
 
55
  if account_id:
56
- supabase_service.save_user_credentials(
57
  email=credentials.jira_email,
58
  api_token=credentials.jira_api_token,
59
  server_url=credentials.jira_server_url,
60
  account_id=account_id
61
  )
62
- logger.info(f"Saved credentials for user {credentials.jira_email} with accountId {account_id}")
 
 
 
63
  else:
64
  logger.warning(f"Could not get accountId for user {credentials.jira_email}, credentials not saved for webhook use")
65
 
 
53
  account_id = myself.get("accountId")
54
 
55
  if account_id:
56
+ success = supabase_service.save_user_credentials(
57
  email=credentials.jira_email,
58
  api_token=credentials.jira_api_token,
59
  server_url=credentials.jira_server_url,
60
  account_id=account_id
61
  )
62
+ if success:
63
+ logger.info(f"Saved credentials for user {credentials.jira_email} with accountId {account_id}")
64
+ else:
65
+ logger.error(f"Failed to save credentials for user {credentials.jira_email} - Supabase check failed")
66
  else:
67
  logger.warning(f"Could not get accountId for user {credentials.jira_email}, credentials not saved for webhook use")
68
 
main.py CHANGED
@@ -15,6 +15,12 @@ logging.basicConfig(
15
 
16
  logger = logging.getLogger(__name__)
17
 
 
 
 
 
 
 
18
  # Create FastAPI app
19
  app = FastAPI(
20
  title="Enterprise Delivery & Workforce Intelligence API",
 
15
 
16
  logger = logging.getLogger(__name__)
17
 
18
+ # Startup Checks
19
+ if settings.supabase_url and settings.supabase_key:
20
+ logger.info("Supabase Integration: ENABLED")
21
+ else:
22
+ logger.warning("Supabase Integration: DISABLED (Missing SUPABASE_URL or SUPABASE_KEY)")
23
+
24
  # Create FastAPI app
25
  app = FastAPI(
26
  title="Enterprise Delivery & Workforce Intelligence API",