Skip to content

Commit

Permalink
revert the failed experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Jan 20, 2025
1 parent d01e09b commit 1c7bd47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ exchange_one_time_code_for_refresh_token code:Text -> Text =
response.get "refresh_token"

make_secret_payload refresh_token:Text -> Text =
JS_Object.from_pairs [["type", "authorized_user"], ["refresh_token", refresh_token], ["client_id", desktop_client_id], ["client_secret", desktop_client_secret]]
JS_Object.from_pairs [["type", "authorized_user"], ["refresh_token", refresh_token], ["client_id", client_id], ["client_secret", client_secret]]
. to_json

create_authorization_uri scopes:Vector -> URI =
Expand All @@ -53,8 +53,6 @@ get_env_var name:Text -> Text =
Environment.get name if_missing=(Panic.throw (Illegal_State.Error "Environment variable not set: "+name))
client_id = get_env_var "GOOGLE_APP_CLIENT_ID"
client_secret = get_env_var "GOOGLE_APP_CLIENT_SECRET"
desktop_client_id = get_env_var "GOOGLE_APP_DESKTOP_CLIENT_ID"
desktop_client_secret = get_env_var "GOOGLE_APP_DESKTOP_CLIENT_SECRET"
redirect_uri = "http://localhost:51234/oauth"

type OAuth_Callback_Response
Expand Down
4 changes: 2 additions & 2 deletions test-google-oauth.enso
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ from Standard.Google_Api import all
import Standard.Google_Api.OAuth_Prototype

main =
secret_name = "google-sheets-4"
secret_name = "google-sheets-"+(Random.uuid.take 4)
secret = Enso_Secret.get secret_name . catch Not_Found _->
scopes = ["https://www.googleapis.com/auth/spreadsheets", "https://www.googleapis.com/auth/drive"]
OAuth_Prototype.authenticate_service scopes "google-sheets-4"
OAuth_Prototype.authenticate_service scopes secret_name
google_sheets = Google_Sheets.initialize secret
table = google_sheets.get_table "1Xa1cXLN4oeCl7FpD_IErfOMHhFuShpc1S5Buc0UF4b0" "Sheet1"
IO.println table
Expand Down

0 comments on commit 1c7bd47

Please sign in to comment.