Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/utils/re_auth/src/oauth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,19 @@ impl InMemoryCredentials {
pub fn ensure_stored(self) -> Result<Credentials, CredentialsStoreError> {
storage::store(&self.0)?;

// Normally if re_analytics discovers this is a brand-new configuration,
// we show an analytics diclaimer. But, during SDK usage with the Catalog
// it's possible to hit this code-path during a first run in a new
// environment. Given the user already has a Rerun identity (or else there
// would be no credentials to store!), we assume they are already opted-in
// to rerun analytics and do not need a disclaimer. By manually forcing the
// creation of the analytics config we bypass the first_run check.
if let Ok(config) = re_analytics::Config::load_or_default() {
if config.is_first_run() {
config.save().ok();
}
}

// Link the analytics ID to the authenticated user
re_analytics::record(|| re_analytics::event::SetPersonProperty {
email: self.0.user.email.clone(),
Expand Down
Loading