mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Expose ui_layout and ai_enabled to mobile clients and add enable_ai endpoint (#983)
* Wire ui layout and AI flags into mobile auth Include ui_layout and ai_enabled in mobile login/signup/SSO payloads, add an authenticated endpoint to enable AI from Flutter, and gate mobile navigation based on intro layout and AI consent flow. * Linter * Ensure write scope on enable_ai * Make sure AI is available before enabling it * Test improvements * PR comment * Fix review issues: test assertion bug, missing coverage, and Dart defaults (#985) - Fix login test to use ai_enabled? (method) instead of ai_enabled (column) to match what mobile_user_payload actually serializes - Add test for enable_ai when ai_available? returns false (403 path) - Default aiEnabled to false when user is null in AuthProvider to avoid showing AI as available before authentication completes - Remove extra blank lines in auth_provider.dart and auth_service.dart https://claude.ai/code/session_01LEYYmtsDBoqizyihFtkye4 Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -260,7 +260,9 @@ class SessionsController < ApplicationController
|
||||
user_id: user.id,
|
||||
user_email: user.email,
|
||||
user_first_name: user.first_name,
|
||||
user_last_name: user.last_name
|
||||
user_last_name: user.last_name,
|
||||
user_ui_layout: user.ui_layout,
|
||||
user_ai_enabled: user.ai_enabled?
|
||||
),
|
||||
expires_in: 5.minutes
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user