()
| 12 | async def initialize(self) -> None: |
| 13 | @self.route('/init', methods=['GET', 'POST'], auth_type=group.AuthType.NONE) |
| 14 | async def _() -> str: |
| 15 | if quart.request.method == 'GET': |
| 16 | return self.success(data={'initialized': await self.ap.user_service.is_initialized()}) |
| 17 | |
| 18 | if await self.ap.user_service.is_initialized(): |
| 19 | return self.fail(1, 'System already initialized') |
| 20 | |
| 21 | json_data = await quart.request.json |
| 22 | |
| 23 | user_email = json_data['user'] |
| 24 | password = json_data['password'] |
| 25 | |
| 26 | await self.ap.user_service.create_user(user_email, password) |
| 27 | |
| 28 | return self.success() |
| 29 | |
| 30 | @self.route('/auth', methods=['POST'], auth_type=group.AuthType.NONE) |
| 31 | async def _() -> str: |
nothing calls this directly
no test coverage detected