Bedrock improvements
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#[allow(dead_code)]
|
||||
pub(super) mod user_persistence;
|
||||
|
||||
use std::result::Result as StdResult;
|
||||
@@ -9,9 +10,11 @@ use settings::Setting as _;
|
||||
use uuid::Uuid;
|
||||
use galaxy_core::channel::ChannelState;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
#[allow(unused_imports)]
|
||||
use galaxy_graphql::mutations::create_anonymous_user::{
|
||||
AnonymousUserType, CreateAnonymousUserResult,
|
||||
};
|
||||
#[allow(unused_imports)]
|
||||
use galaxyui::{clipboard::ClipboardContent, Entity, ModelContext, SingletonEntity, UpdateModel};
|
||||
|
||||
use super::auth_state::{AuthState, PersistAction};
|
||||
@@ -55,6 +58,7 @@ use url::Url;
|
||||
use user_persistence::PersistedUser;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum AuthManagerEvent {
|
||||
/// Successfully authenticated a user with no errors.
|
||||
AuthComplete,
|
||||
@@ -102,6 +106,7 @@ pub struct AuthManager {
|
||||
pending_auth_state: Option<String>,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl AuthManager {
|
||||
/// Creates a new instance of the AuthManager. The auth state must already be initialized through
|
||||
/// [`AuthStateProvider`].
|
||||
|
||||
@@ -9,6 +9,7 @@ pub enum AuthOverrideWarningModalVariant {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum AuthOverrideWarningModalEvent {
|
||||
Close,
|
||||
BulkExport,
|
||||
|
||||
@@ -87,6 +87,7 @@ impl AuthState {
|
||||
state
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn should_use_test_user() -> bool {
|
||||
cfg!(any(test, feature = "skip_login")) || ChannelState::channel() == Channel::Integration
|
||||
}
|
||||
@@ -131,6 +132,7 @@ impl AuthState {
|
||||
}
|
||||
|
||||
/// Applies a deserialized PersistedUser, splitting it into User and Credentials.
|
||||
#[allow(dead_code)]
|
||||
fn apply_persisted_user(&self, persisted: PersistedUser) {
|
||||
let user = User {
|
||||
is_onboarded: persisted.is_onboarded,
|
||||
@@ -171,6 +173,7 @@ impl AuthState {
|
||||
|
||||
/// Updates the Firebase auth tokens within the current credentials.
|
||||
/// Reports an error if the current credentials are not Firebase.
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn update_firebase_tokens(&self, new_auth_tokens: FirebaseAuthTokens) {
|
||||
let mut write_lock = self.credentials.write();
|
||||
if let Some(Credentials::Firebase(tokens)) = write_lock.as_mut() {
|
||||
|
||||
@@ -27,6 +27,7 @@ pub enum AuthViewVariant {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum AuthViewEvent {
|
||||
Close,
|
||||
}
|
||||
@@ -67,8 +68,10 @@ impl TypedActionView for AuthView {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum LoginFailureReason {
|
||||
InvalidRedirectUrl { was_pasted: bool },
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn init(_app: &mut AppContext) {}
|
||||
|
||||
@@ -9,6 +9,7 @@ pub enum LoginSlideSource {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum LoginSlideEvent {
|
||||
BackToOnboarding,
|
||||
LoginLaterConfirmed,
|
||||
|
||||
@@ -51,9 +51,11 @@ use crate::{persistence, GlobalResourceHandlesProvider};
|
||||
use crate::{report_if_error, send_telemetry_sync_from_app_ctx};
|
||||
|
||||
/// Prefix for API keys used in authentication
|
||||
#[allow(dead_code)]
|
||||
#[cfg_attr(target_family = "wasm", allow(dead_code))]
|
||||
pub const API_KEY_PREFIX: &str = "wk-";
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn init(_app: &mut AppContext) {}
|
||||
|
||||
/// If the app has running processes or dirty objects, we'll show a confirmation modal before logging out.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use galaxyui::{AppContext, Element, Entity, TypedActionView, View, ViewContext};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum PasteAuthTokenModalEvent {
|
||||
Cancelled,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user