Handles user signup by creating a new user with the provided email and password.
(request: Request, body: SignupSchema)
| 495 | |
| 496 | @public_route |
| 497 | async def auth_signup(request: Request, body: SignupSchema) -> StatusResponse: |
| 498 | """ |
| 499 | Handles user signup by creating a new user with the provided email and password. |
| 500 | """ |
| 501 | supabase = get_supabase() |
| 502 | |
| 503 | try: |
| 504 | auth_response = supabase.auth.sign_up( |
| 505 | { |
| 506 | 'email': body.email, |
| 507 | 'password': body.password, |
| 508 | 'options': { |
| 509 | 'data': { |
| 510 | 'full_name': body.full_name, |
| 511 | } |
| 512 | }, |
| 513 | } |
| 514 | ) |
| 515 | except gotrue.errors.AuthApiError as e: |
| 516 | raise AuthException.from_gotrue_autherror(e) |
| 517 | |
| 518 | if hasattr(auth_response, 'error'): |
| 519 | raise AuthException("Failed to sign up user.") |
| 520 | |
| 521 | return StatusResponse(message="User signed up successfully.") |
| 522 | |
| 523 | |
| 524 | @public_route |
nothing calls this directly
no test coverage detected
searching dependent graphs…