Skip to content

Commit

Permalink
fix: logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfonseca committed Apr 18, 2024
1 parent dba2499 commit a67ce51
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ class Config:

@validator("clientSecret", always=True)
def client_secret_only_on_dev(cls, v: Optional[str]) -> Optional[str]:
if v and not powertools_dev_is_set():
if not v:
return None

if not powertools_dev_is_set():
raise ValueError(
"cannot use client_secret without POWERTOOLS_DEV mode. See "
"https://docs.powertools.aws.dev/lambda/python/latest/#optimizing-for-non-production-environments",
Expand All @@ -63,8 +66,7 @@ def client_secret_only_on_dev(cls, v: Optional[str]) -> Optional[str]:
"DO NOT USE THIS OUTSIDE LOCAL DEVELOPMENT",
stacklevel=2,
)

return v
return v


def generate_oauth2_redirect_html() -> str:
Expand Down

0 comments on commit a67ce51

Please sign in to comment.