diff --git a/Cargo.lock b/Cargo.lock index 6f8c882..cbcaa82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,7 +149,7 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "app" -version = "0.1.4" +version = "0.1.5" dependencies = [ "anyhow", "async-stream", @@ -885,7 +885,7 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "cli" -version = "0.1.4" +version = "0.1.5" dependencies = [ "anyhow", "backend", @@ -1248,7 +1248,7 @@ dependencies = [ [[package]] name = "db" -version = "0.1.4" +version = "0.1.5" dependencies = [ "anyhow", "backend", @@ -1484,7 +1484,7 @@ dependencies = [ [[package]] name = "entity" -version = "0.1.4" +version = "0.1.5" dependencies = [ "sea-orm", "serde", @@ -3010,7 +3010,7 @@ dependencies = [ [[package]] name = "migration" -version = "0.1.4" +version = "0.1.5" dependencies = [ "async-std", "sea-orm-migration", @@ -3340,6 +3340,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "os_info" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" +dependencies = [ + "log", + "serde", + "winapi", +] + [[package]] name = "ouroboros" version = "0.17.2" @@ -5458,6 +5469,19 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sys-locale" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" +dependencies = [ + "js-sys", + "libc", + "wasm-bindgen", + "web-sys", + "windows-sys 0.45.0", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -5613,6 +5637,7 @@ dependencies = [ "minisign-verify", "objc", "once_cell", + "os_info", "percent-encoding", "rand 0.8.5", "raw-window-handle", @@ -5624,6 +5649,7 @@ dependencies = [ "serde_repr", "serialize-to-javascript", "state", + "sys-locale", "tar", "tauri-macros", "tauri-runtime", @@ -6712,6 +6738,15 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -6730,6 +6765,21 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -6776,6 +6826,12 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -6800,6 +6856,12 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -6824,6 +6886,12 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -6854,6 +6922,12 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -6878,6 +6952,12 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -6890,6 +6970,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -6914,6 +7000,12 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 4947116..1e1cbfa 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cli" -version = "0.1.4" +version = "0.1.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/db/Cargo.toml b/db/Cargo.toml index 1007de9..8a5b9d7 100644 --- a/db/Cargo.toml +++ b/db/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "db" -version = "0.1.4" +version = "0.1.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/db/entity/Cargo.toml b/db/entity/Cargo.toml index 6dd408b..cc07957 100644 --- a/db/entity/Cargo.toml +++ b/db/entity/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "entity" -version = "0.1.4" +version = "0.1.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/db/migration/Cargo.toml b/db/migration/Cargo.toml index 41cb439..f4d3bc5 100644 --- a/db/migration/Cargo.toml +++ b/db/migration/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "migration" -version = "0.1.4" +version = "0.1.5" edition = "2021" publish = false diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index 7afe9de..132b84d 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.1.4" +version = "0.1.5" description = "An advanced field scheduling and logistics app" authors = ["Mateo Rodriguez"] license = "" @@ -17,7 +17,7 @@ tauri-build = { version = "1.5.1", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "1.5.4", features = ["updater", "dialog-all"] } +tauri = { version = "1.5.4", features = [ "os-all", "updater", "dialog-all"] } grpc_server = { path = "../gcloud/grpc_server" } backend = { path = "../backend" } db = { path = "../db" } diff --git a/desktop/tauri.conf.json b/desktop/tauri.conf.json index 4a364ef..47eb6f5 100644 --- a/desktop/tauri.conf.json +++ b/desktop/tauri.conf.json @@ -13,6 +13,9 @@ "all": false, "dialog": { "all": true + }, + "os": { + "all": true } }, "bundle": { diff --git a/package.json b/package.json index fe5991a..a639d93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fieldz-desktop", - "version": "0.1.4", + "version": "0.1.5", "scripts": { "preinstall": "cd webview && npm install" }, diff --git a/webview/src/routes/login/+page.svelte b/webview/src/routes/login/+page.svelte index cd6ed97..c9aa4d5 100644 --- a/webview/src/routes/login/+page.svelte +++ b/webview/src/routes/login/+page.svelte @@ -5,7 +5,8 @@ signInWithPopup, getAuth, GithubAuthProvider, - OAuthProvider + OAuthProvider, + signInWithRedirect } from 'firebase/auth'; import { goto } from '$app/navigation'; import { slide } from 'svelte/transition'; @@ -14,12 +15,27 @@ import TwitterIcon from './TwitterIcon.svelte'; import GitHubIcon from './GitHubIcon.svelte'; import MicrosoftIcon from './MicrosoftIcon.svelte'; + import { type } from '@tauri-apps/api/os'; const queryParams = new URLSearchParams(window.location.search); const next = queryParams.get('next') ?? '/'; const toastStore = getToastStore(); + const signInFunction = type().then((type) => { + switch (type) { + /* + * The webview on OSX does not support browser popups. + * Why, you might ask? + * No one knows :( + */ + case 'Darwin': + return signInWithRedirect; + default: + return signInWithPopup; + } + }); + function duplicatedMessage(error: any) { if ('code' in error && error.code === 'auth/account-exists-with-different-credential') { toastStore.trigger({ @@ -40,7 +56,7 @@ prompt: 'select_account' }); - const userCredential = await signInWithPopup(getAuth(), provider); + const userCredential = await (await signInFunction)(getAuth(), provider); console.log(userCredential); @@ -58,7 +74,7 @@ prompt: 'select_account' }); - const userCredential = await signInWithPopup(getAuth(), provider); + const userCredential = await (await signInFunction)(getAuth(), provider); console.log(userCredential); @@ -73,7 +89,7 @@ try { const provider = new GithubAuthProvider(); - const userCredential = await signInWithPopup(getAuth(), provider); + const userCredential = await (await signInFunction)(getAuth(), provider); console.log(userCredential); @@ -91,7 +107,7 @@ prompt: 'select_account' }); - const userCredential = await signInWithPopup(getAuth(), provider); + const userCredential = await (await signInFunction)(getAuth(), provider); console.log(userCredential); @@ -110,19 +126,19 @@ >