Skip to content

Commit

Permalink
fix 'you must specify a region' error
Browse files Browse the repository at this point in the history
  • Loading branch information
NodeJSmith committed Jan 7, 2025
1 parent 1951be7 commit 63f3263
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/otf_api/auth/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
LOGGER = getLogger(__name__)
CLIENT_ID = "1457d19r0pcjgmp5agooi0rb1b" # from android app
USER_POOL_ID = "us-east-1_dYDxUeyL1"
REGION = "us-east-1"

BOTO_CONFIG = Config(region_name=REGION, signature_version=UNSIGNED)


class OtfAuth:
Expand Down Expand Up @@ -120,7 +123,7 @@ def setup_cognito(self, tokens: CognitoTokens) -> None:
access_token=tokens.access_token,
id_token=tokens.id_token,
refresh_token=tokens.refresh_token,
botocore_config=Config(signature_version=UNSIGNED),
botocore_config=BOTO_CONFIG,
)

self.validate_cognito_tokens()
Expand Down Expand Up @@ -155,7 +158,7 @@ def get_awssrp(self) -> AWSSRP:
kwargs = {
"pool_id": USER_POOL_ID,
"client_id": CLIENT_ID,
"client": boto3.client("cognito-idp", config=Config(signature_version=UNSIGNED)),
"client": boto3.client("cognito-idp", config=BOTO_CONFIG),
}

dd = self.config.dd_cache.get_cached_data() if self.config.cache_device_data else {}
Expand Down

0 comments on commit 63f3263

Please sign in to comment.