Skip to content

Commit a67ce51

Browse files
committed
fix: logic
1 parent dba2499 commit a67ce51

File tree

1 file changed

+5
-3
lines changed
  • aws_lambda_powertools/event_handler/openapi/swagger_ui

1 file changed

+5
-3
lines changed

aws_lambda_powertools/event_handler/openapi/swagger_ui/oauth2.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class Config:
5252

5353
@validator("clientSecret", always=True)
5454
def client_secret_only_on_dev(cls, v: Optional[str]) -> Optional[str]:
55-
if v and not powertools_dev_is_set():
55+
if not v:
56+
return None
57+
58+
if not powertools_dev_is_set():
5659
raise ValueError(
5760
"cannot use client_secret without POWERTOOLS_DEV mode. See "
5861
"https://docs.powertools.aws.dev/lambda/python/latest/#optimizing-for-non-production-environments",
@@ -63,8 +66,7 @@ def client_secret_only_on_dev(cls, v: Optional[str]) -> Optional[str]:
6366
"DO NOT USE THIS OUTSIDE LOCAL DEVELOPMENT",
6467
stacklevel=2,
6568
)
66-
67-
return v
69+
return v
6870

6971

7072
def generate_oauth2_redirect_html() -> str:

0 commit comments

Comments
 (0)