marcenacp commited on
Commit
993d03b
1 Parent(s): 7f781f8

Deploy (see actual commits on https://github.com/mlcommons/croissant).

Browse files
app.py CHANGED
@@ -7,6 +7,7 @@ from core.constants import OAUTH_CLIENT_ID
7
  from core.constants import OAUTH_STATE
8
  from core.constants import REDIRECT_URI
9
  from core.query_params import clear_query_params
 
10
  from core.query_params import get_project_timestamp
11
  from core.query_params import get_state
12
  from core.state import CurrentProject
@@ -23,9 +24,9 @@ init_state()
23
  user = get_user()
24
 
25
  if OAUTH_CLIENT_ID and not user:
26
- state = get_state("state")
27
- if state and state[0] == OAUTH_STATE:
28
- code = query_params["code"]
29
  if not code:
30
  st.stop()
31
  try:
 
7
  from core.constants import OAUTH_STATE
8
  from core.constants import REDIRECT_URI
9
  from core.query_params import clear_query_params
10
+ from core.query_params import get_code
11
  from core.query_params import get_project_timestamp
12
  from core.query_params import get_state
13
  from core.state import CurrentProject
 
24
  user = get_user()
25
 
26
  if OAUTH_CLIENT_ID and not user:
27
+ state = get_state()
28
+ if state and state == OAUTH_STATE:
29
+ code = get_code()
30
  if not code:
31
  st.stop()
32
  try:
components/tabs/frontend/package-lock.json CHANGED
@@ -8908,9 +8908,9 @@
8908
  "dev": true
8909
  },
8910
  "node_modules/follow-redirects": {
8911
- "version": "1.15.3",
8912
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
8913
- "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
8914
  "dev": true,
8915
  "funding": [
8916
  {
 
8908
  "dev": true
8909
  },
8910
  "node_modules/follow-redirects": {
8911
+ "version": "1.15.5",
8912
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
8913
+ "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
8914
  "dev": true,
8915
  "funding": [
8916
  {
components/tree/frontend/package-lock.json CHANGED
@@ -8972,9 +8972,9 @@
8972
  "dev": true
8973
  },
8974
  "node_modules/follow-redirects": {
8975
- "version": "1.15.3",
8976
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
8977
- "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
8978
  "dev": true,
8979
  "funding": [
8980
  {
 
8972
  "dev": true
8973
  },
8974
  "node_modules/follow-redirects": {
8975
+ "version": "1.15.5",
8976
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz",
8977
+ "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
8978
  "dev": true,
8979
  "funding": [
8980
  {
core/query_params.py CHANGED
@@ -74,6 +74,10 @@ def get_state() -> str | None:
74
  return _get_query_param("state")
75
 
76
 
 
 
 
 
77
  def set_project(project: CurrentProject):
78
  _set_query_param(QueryParams.OPEN_PROJECT, project.path.name)
79
 
 
74
  return _get_query_param("state")
75
 
76
 
77
+ def get_code():
78
+ return _get_query_param("code")
79
+
80
+
81
  def set_project(project: CurrentProject):
82
  _set_query_param(QueryParams.OPEN_PROJECT, project.path.name)
83