(self, web_data)
| 63 | return response |
| 64 | |
| 65 | async def auth_with_web_data(self, web_data) -> dict: |
| 66 | resp = await self.post(url=f"{self.user_url}/api/v1/auth/provider/PROVIDER_TELEGRAM_MINI_APP", data=web_data) |
| 67 | resp_json = await resp.json() |
| 68 | if resp.status == 200: |
| 69 | return resp_json |
| 70 | if resp.status == 520: |
| 71 | raise NeedReLoginError() |
| 72 | if resp.status == 500 and "Invalid username" in resp_json.get('message'): |
| 73 | raise InvalidUsernameError(f"response data: {resp_json.get('message')}") |
| 74 | if resp.status == 500 and "account is already connected" in resp_json.get('message'): |
| 75 | raise AlreadyConnectError(f"response data: {resp_json.get('message')}") |
| 76 | if resp.status == 409: |
| 77 | raise UsernameNotAvailableError(f"response data: {resp_json.get('message')}") |
| 78 | raise Exception(f"error auth_with_web_data. resp[{resp.status}]: {resp_json}") |
| 79 | |
| 80 | |
| 81 | async def login(self, web_data_params: str): |
no test coverage detected