samsl commited on
Commit
3ca7567
·
1 Parent(s): 6b88dbf

explicitly pull string value from token

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -422,12 +422,14 @@ def visualize_network(
422
  return fig, bc_highlight, comm_highlight, out_cluster_file_name
423
 
424
 
425
- def check_user_access(token: gr.OAuthToken | None):
426
  """Check if user is logged in and has access to private repo"""
427
 
428
- if token is None:
429
  raise gr.Error("Please log in to use this Space")
430
 
 
 
431
  try:
432
  # Try to access a file from your private repo
433
  api = HfApi(token=token)
 
422
  return fig, bc_highlight, comm_highlight, out_cluster_file_name
423
 
424
 
425
+ def check_user_access(oauth_token: gr.OAuthToken | None):
426
  """Check if user is logged in and has access to private repo"""
427
 
428
+ if oauth_token is None:
429
  raise gr.Error("Please log in to use this Space")
430
 
431
+ token = oauth_token.token
432
+
433
  try:
434
  # Try to access a file from your private repo
435
  api = HfApi(token=token)