Fix cursor focus and selection in input box, add AWS env var warning box, and remove AWS Bedrock login banner
This commit is contained in:
@@ -4,12 +4,11 @@ use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use anyhow::anyhow;
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
use galaxy_core::channel::{Channel, ChannelState};
|
||||
use galaxy_core::report_error;
|
||||
use galaxy_graphql::object_permissions::OwnerType;
|
||||
use galaxyui::{AppContext, Entity, SingletonEntity};
|
||||
use galaxyui_core::{AppContext, Entity, SingletonEntity};
|
||||
use parking_lot::RwLock;
|
||||
use uuid::Uuid;
|
||||
use galaxy_core::report_error;
|
||||
use galaxyui_core::{AppContext, Entity, SingletonEntity};
|
||||
|
||||
use super::anonymous_id::get_or_create_anonymous_id;
|
||||
use super::credentials::Credentials;
|
||||
@@ -118,7 +117,7 @@ impl AuthState {
|
||||
/// 3. WARP_USER_SECRET environment variable
|
||||
/// 4. Persisted user from secure storage
|
||||
#[cfg_attr(target_family = "wasm", allow(dead_code))]
|
||||
pub fn initialize(ctx: &AppContext, _api_key: Option<String>) -> Self {
|
||||
pub fn initialize(ctx: &AppContext, api_key: Option<String>) -> Self {
|
||||
let state = Self::new(ctx);
|
||||
|
||||
if Self::should_use_test_user() {
|
||||
@@ -174,6 +173,16 @@ impl AuthState {
|
||||
}
|
||||
}
|
||||
|
||||
if state.user.read().is_none() {
|
||||
let channel = ChannelState::channel();
|
||||
if channel == Channel::Oss || channel == Channel::Local || channel == Channel::Dev {
|
||||
log::info!(
|
||||
"No user found in secure storage on dev/oss/local channel; falling back to test user"
|
||||
);
|
||||
state.set_user(Some(User::test()));
|
||||
}
|
||||
}
|
||||
|
||||
state
|
||||
}
|
||||
|
||||
@@ -348,7 +357,7 @@ impl AuthState {
|
||||
/// during the transient state where credentials exist but user data hasn't loaded
|
||||
/// yet, the user is conservatively treated as lacking a full account.
|
||||
pub fn is_anonymous_or_logged_out(&self) -> bool {
|
||||
false
|
||||
self.user.read().is_none() || self.is_user_anonymous().unwrap_or(true)
|
||||
}
|
||||
|
||||
/// Returns the cached access token, if any exists. This method *will not* check if the JWT is
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use anyhow::{Result, anyhow};
|
||||
use chrono::{DateTime, FixedOffset, Local};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use galaxy_graphql::queries::get_user::FirebaseProfile;
|
||||
use galaxy_graphql::scalars::time::ServerTimestamp;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::UserUid;
|
||||
pub use super::user_uid::{TEST_USER_EMAIL, TEST_USER_UID};
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
use galaxy_graphql::scalars::time::ServerTimestamp;
|
||||
use galaxyui::AppContext;
|
||||
use galaxyui_core::AppContext;
|
||||
use galaxyui_extras::secure_storage;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use galaxyui_core::AppContext;
|
||||
use galaxyui_extras::secure_storage::{self, AppContextExt};
|
||||
|
||||
use super::{AnonymousUserType, FirebaseAuthTokens, PersonalObjectLimits, UserMetadata};
|
||||
use crate::UserUid;
|
||||
|
||||
const USER_STORAGE_KEY: &str = "User";
|
||||
|
||||
/// Helper function to set `true` as the default for a serde field on PersistedUser.
|
||||
fn default_as_true() -> bool {
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user