fix: move email-in-address endpoint from /auth to /api/v1 prefix
The GET /me/email-in-address endpoint was unreachable because the Gateway HTTPRoute routes all /auth/* traffic to Better-Auth (port 3001), not the API service. This change: - Moves the endpoint from the /auth router to a new /api/v1/me/ router - Adds EmailInAddressResponse schema and get_email_in_address service method - Updates Settings.tsx to call /api/v1/me/email-in-address Fixes CAR-445. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -66,3 +66,14 @@ class AuthService:
|
||||
|
||||
await self.db.delete(user)
|
||||
await self.db.commit()
|
||||
|
||||
async def get_email_in_address(self, user_id: str) -> str:
|
||||
"""Return the per-user email-in address for receipt forwarding."""
|
||||
from cartsnitch_api.models import User
|
||||
|
||||
result = await self.db.execute(select(User).where(User.id == user_id))
|
||||
user = result.scalar_one_or_none()
|
||||
if not user:
|
||||
raise LookupError("User not found")
|
||||
|
||||
return f"{user.email_inbound_token}@email.cartsnitch.com"
|
||||
|
||||
Reference in New Issue
Block a user