Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix[tauri]: ability to actually log out of mobile app (#2145)

Peter Chinman061513fe1b9d
diff --git a/js/app/bun.lock b/js/app/bun.lock
index c3340c31de..1e486a7fbd 100644
--- a/js/app/bun.lock
+++ b/js/app/bun.lock
@@ -23,7 +23,7 @@
"@floating-ui/dom": "^1.7.4",
"@fontsource-variable/inter": "^5.2.8",
"@fontsource-variable/roboto-mono": "^5.2.8",
- "@inkibra/tauri-plugins": "git+https://github.com/seanaye/tauri-plugins.git#0c932ffd3202145b40645246d87a38deb72ba09c",
+ "@inkibra/tauri-plugins": "git+https://github.com/macro-inc/tauri-plugins.git#2b2257722f60458921eadf4a9ab4d9e1db36e34f",
"@kobalte/core": "^0.13.11",
"@leeoniya/ufuzzy": "^1.0.19",
"@lexical/history": "^0.32.1",
@@ -757,7 +757,7 @@
"@iconify/utils": ["@iconify/[email protected]", "", { "dependencies": { "@antfu/install-pkg": "^1.0.0", "@antfu/utils": "^8.1.0", "@iconify/types": "^2.0.0", "debug": "^4.4.0", "globals": "^15.14.0", "kolorist": "^1.8.0", "local-pkg": "^1.0.0", "mlly": "^1.7.4" } }, "sha512-GmQ78prtwYW6EtzXRU1rY+KwOKfz32PD7iJh6Iyqw68GiKuoZ2A6pRtzWONz5VQJbp50mEjXh/7NkumtrAgRKA=="],
- "@inkibra/tauri-plugins": ["@inkibra/tauri-plugins@github:seanaye/tauri-plugins#0c932ff", { "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "seanaye-tauri-plugins-0c932ff"],
+ "@inkibra/tauri-plugins": ["@inkibra/tauri-plugins@github:macro-inc/tauri-plugins#2b22577", { "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" } }, "macro-inc-tauri-plugins-2b22577"],
"@internationalized/date": ["@internationalized/[email protected]", "", { "dependencies": { "@swc/helpers": "^0.5.0" } }, "sha512-jLxQjefH9VI5P9UQuqB6qNKnvFt1Ky1TPIzHGsIlCi7sZZoMR8SdYbBGRvM0y+Jtb+ez4ieBzmiAUcpmPYpyOw=="],
diff --git a/js/app/package.json b/js/app/package.json
index ade3ccabda..f7a9c12cc7 100644
--- a/js/app/package.json
+++ b/js/app/package.json
@@ -40,7 +40,7 @@
"@floating-ui/dom": "^1.7.4",
"@fontsource-variable/inter": "^5.2.8",
"@fontsource-variable/roboto-mono": "^5.2.8",
- "@inkibra/tauri-plugins": "git+https://github.com/seanaye/tauri-plugins.git#0c932ffd3202145b40645246d87a38deb72ba09c",
+ "@inkibra/tauri-plugins": "git+https://github.com/macro-inc/tauri-plugins.git#2b2257722f60458921eadf4a9ab4d9e1db36e34f",
"@kobalte/core": "^0.13.11",
"@leeoniya/ufuzzy": "^1.0.19",
"@lexical/history": "^0.32.1",
diff --git a/js/app/packages/app/component/auth/LoginOptions.tsx b/js/app/packages/app/component/auth/LoginOptions.tsx
index 691284687f..569980f07c 100644
--- a/js/app/packages/app/component/auth/LoginOptions.tsx
+++ b/js/app/packages/app/component/auth/LoginOptions.tsx
@@ -72,7 +72,11 @@ export function LoginOptions(props: { setStage: (next: Stage) => void }) {
token?: string;
error?: string;
}>('plugin:auth|authenticate', {
- payload: { authUrl: authUrl.toString(), callbackScheme: 'macro' },
+ payload: {
+ authUrl: authUrl.toString(),
+ callbackScheme: 'macro',
+ ephemeralSession: true,
+ },
});
if (!result.success || !result.token) {
diff --git a/js/app/packages/core/auth/logout.ts b/js/app/packages/core/auth/logout.ts
index 1c54c7bd3f..f92706533f 100644
--- a/js/app/packages/core/auth/logout.ts
+++ b/js/app/packages/core/auth/logout.ts
@@ -4,9 +4,12 @@ import { queryClient } from '@queries/client';
import { SERVER_HOSTS } from '@core/constant/servers';
import { createCallback } from '@solid-primitives/rootless';
import { useAnalytics } from '@app/component/analytics-context';
+import { isNativeMobilePlatform } from '@core/mobile/isNativeMobilePlatform';
+import { useNavigate } from '@solidjs/router';
export function useLogout() {
const analytics = useAnalytics();
+ const navigate = useNavigate();
return createCallback(async () => {
document.cookie =
@@ -30,6 +33,15 @@ export function useLogout() {
analytics.track('sign_out');
analytics.reset();
- window.location.href = SERVER_HOSTS['auth-logout'];
+ if (isNativeMobilePlatform()) {
+ await fetch(SERVER_HOSTS['auth-logout'], {
+ credentials: 'include',
+ mode: 'no-cors',
+ redirect: 'manual',
+ }).catch(() => {});
+ navigate('/login');
+ } else {
+ window.location.href = SERVER_HOSTS['auth-logout'];
+ }
});
}
diff --git a/js/app/tauri/Cargo.lock b/js/app/tauri/Cargo.lock
index def1393865..945d0a8c5f 100644
--- a/js/app/tauri/Cargo.lock
+++ b/js/app/tauri/Cargo.lock
@@ -4530,7 +4530,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-auth"
version = "0.1.0"
-source = "git+https://github.com/seanaye/tauri-plugins?branch=main#5863bef82f3327e3358d0c1a13f5994c25c5ce3e"
+source = "git+https://github.com/macro-inc/tauri-plugins?rev=2b2257722f60458921eadf4a9ab4d9e1db36e34f#2b2257722f60458921eadf4a9ab4d9e1db36e34f"
dependencies = [
"serde",
"tauri",
@@ -4662,7 +4662,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-notifications"
version = "0.1.0"
-source = "git+https://github.com/seanaye/tauri-plugins?branch=seanaye%2Bmnlphlp%2Fadd%2Fandroid-notifications#8a1be0b1efe16d8819f681c0f9939fc1ba7fe44f"
+source = "git+https://github.com/macro-inc/tauri-plugins?rev=2b2257722f60458921eadf4a9ab4d9e1db36e34f#2b2257722f60458921eadf4a9ab4d9e1db36e34f"
dependencies = [
"serde",
"tauri",
diff --git a/js/app/tauri/src-tauri/Cargo.toml b/js/app/tauri/src-tauri/Cargo.toml
index ad1cc7f1bf..dcce617e52 100644
--- a/js/app/tauri/src-tauri/Cargo.toml
+++ b/js/app/tauri/src-tauri/Cargo.toml
@@ -50,7 +50,7 @@ urlencoding = "2.1.3"
tauri-plugin-notification = "2"
# push notifications for mobile (when app is closed)
navigation_plugin = { path = "../navigation_plugin" }
-tauri-plugin-notifications = { git = "https://github.com/seanaye/tauri-plugins", branch = "seanaye+mnlphlp/add/android-notifications" }
+tauri-plugin-notifications = { git = "https://github.com/macro-inc/tauri-plugins", rev = "2b2257722f60458921eadf4a9ab4d9e1db36e34f" }
tauri-plugin-os = "2"
tauri-plugin-virtual-keyboard = { git = "https://github.com/voxelbee/tauri-plugin-virtual-keyboard", branch = "main" }
@@ -60,4 +60,4 @@ tauri-plugin-single-instance = { version = "2", features = ["deep-link"] }
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
tauri-plugin-haptics = "2"
-tauri-plugin-auth = { git = "https://github.com/seanaye/tauri-plugins", branch = "main" }
+tauri-plugin-auth = { git = "https://github.com/macro-inc/tauri-plugins", rev = "2b2257722f60458921eadf4a9ab4d9e1db36e34f" }