Skip to content

Commit ee58859

Browse files
committed
feat: redirect to error page if refresh_token doesn't exist
Signed-off-by: Youngjin Jo <[email protected]>
1 parent 16bcbc5 commit ee58859

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/cloudforet/console_api_v2/service/auth_service.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,9 @@ def saml(self, params: dict) -> RedirectResponse:
6363
credentials = self._extract_credentials(
6464
request, console_api_v2_endpoint, dict(form_data)
6565
)
66-
6766
domain_name = self._get_domain_name(domain_id)
68-
if credentials:
69-
refresh_token = self._issue_token(credentials, domain_id)
70-
return self._redirect_response(domain_name, refresh_token)
71-
else:
72-
return self._redirect_response(domain_name, None)
67+
refresh_token = self._issue_token(credentials, domain_id)
68+
return self._redirect_response(domain_name, refresh_token)
7369

7470
def saml_sp_metadata(self, domain_id: str) -> Response:
7571
sp_entity_id = domain_id
@@ -168,7 +164,7 @@ def _get_domain_name(domain_id: str) -> str:
168164

169165
@staticmethod
170166
def _redirect_response(
171-
domain_name: str, refresh_token: Union[str, None]
167+
domain_name: str, refresh_token: str = None
172168
) -> RedirectResponse:
173169
console_domain: str = config.get_global("CONSOLE_DOMAIN").format(
174170
domain_name=domain_name

0 commit comments

Comments
 (0)