Skip to content

Conversation

@nareksa
Copy link
Contributor

@nareksa nareksa commented Apr 13, 2023

No description provided.

@nareksa nareksa requested a review from VaghinakDev April 13, 2023 12:47
first_name: Optional[str]
last_name: Optional[str]
email: Optional[str]
picture: Optional[str]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove

Comment on lines 619 to 628
try:
response = self._service_provider.get_user(self._team_id)
if not response.ok:
raise AppException(response.error)
self._response.data = response.data
except Exception:
raise AppException(
"Unable to retrieve user data. Please verify your credentials."
) from None
return self._response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try:
response = self._service_provider.get_user(self._team_id)
if not response.ok:
raise AppException(response.error)
self._response.data = response.data
except Exception:
raise AppException(
"Unable to retrieve user data. Please verify your credentials."
) from None
return self._response
response = self._service_provider.get_user(self._team_id)
if not response.ok:
self._response.errors =AppException(
"Unable to retrieve user data. Please verify your credentials."
)
else:
self._response.data = response.data
return self._response

Comment on lines 837 to 841
def get_current_user(self):
return usecases.GetCurrentUserUseCase(
service_provider=self.service_provider, team_id=self.team_id
).execute()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_current_user(self):
return usecases.GetCurrentUserUseCase(
service_provider=self.service_provider, team_id=self.team_id
).execute()
def get_current_user(self) -> UserEntity:
response = usecases.GetCurrentUserUseCase(
service_provider=self.service_provider, team_id=self.team_id
).execute()
if response.errors:
raise AppException(response.errors)
return response.data

return self._user

@staticmethod
def validate_token(token: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this function

@nareksa nareksa requested a review from VaghinakDev April 13, 2023 14:31
@nareksa nareksa merged commit 8698998 into friday Apr 14, 2023
@nareksa nareksa deleted the 1900_auth branch April 14, 2023 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants