fix: store menu 404, logger crash, platform detection, and sidebar UX
All checks were successful
All checks were successful
- Fix store menu API URL (/store/menu/render/store, not /store/core/...) - Fix storeLog/merchantLog fallback to console object instead of console.log - Embed platform_id/platform_code in store JWT from URL context at login - Use token_platform_id in store menu endpoint with DB fallback for old tokens - Add "Menu unavailable" warning in sidebar fallback for all three frontends - Standardize admin section default to all-open (consistent with store/merchant) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,7 @@ from app.modules.tenancy.models.user_password_reset_token import (
|
||||
UserPasswordResetToken, # noqa: API-007
|
||||
)
|
||||
from app.modules.tenancy.services.user_auth_service import user_auth_service
|
||||
from middleware.platform_context import get_current_platform
|
||||
from middleware.store_context import get_current_store
|
||||
from models.schema.auth import LogoutResponse, StoreUserResponse, UserContext, UserLogin
|
||||
|
||||
@@ -110,12 +111,19 @@ def store_login(
|
||||
f"for store {store.store_code} as {store_role}"
|
||||
)
|
||||
|
||||
# Get platform from URL context (middleware-detected)
|
||||
platform = get_current_platform(request)
|
||||
platform_id = platform.id if platform else None
|
||||
platform_code = platform.code if platform else None
|
||||
|
||||
# Create store-scoped access token with store information
|
||||
token_data = auth_service.auth_manager.create_access_token(
|
||||
user=user,
|
||||
store_id=store.id,
|
||||
store_code=store.store_code,
|
||||
store_role=store_role,
|
||||
platform_id=platform_id,
|
||||
platform_code=platform_code,
|
||||
)
|
||||
|
||||
# Set HTTP-only cookie for browser navigation
|
||||
|
||||
Reference in New Issue
Block a user