diff --git a/apps/readest-app/public/.well-known/apple-app-site-association b/apps/readest-app/public/.well-known/apple-app-site-association new file mode 100644 index 00000000..097f8bb8 --- /dev/null +++ b/apps/readest-app/public/.well-known/apple-app-site-association @@ -0,0 +1,17 @@ +{ + "applinks": { + "details": [ + { + "appIDs": [ + "J5W48D69VR.com.bilingify.readest" + ], + "components": [ + { + "/": "/auth/*", + "comment": "Matches any URL whose path starts with /auth/" + } + ] + } + ] + } +} diff --git a/apps/readest-app/public/.well-known/assetlinks.json b/apps/readest-app/public/.well-known/assetlinks.json new file mode 100644 index 00000000..3858951f --- /dev/null +++ b/apps/readest-app/public/.well-known/assetlinks.json @@ -0,0 +1,12 @@ +[ + { + "relation": ["delegate_permission/common.handle_all_urls"], + "target": { + "namespace": "android_app", + "package_name": "com.bilingify.readest", + "sha256_cert_fingerprints": [ + "65:2D:11:67:76:12:29:14:18:42:CB:3D:18:50:B6:E4:7E:46:E1:2F:4B:E4:7F:5A:6C:14:B6:D7:12:74:1E:82" + ] + } + } +] diff --git a/apps/readest-app/src-tauri/tauri.conf.json b/apps/readest-app/src-tauri/tauri.conf.json index d919131e..b104b017 100644 --- a/apps/readest-app/src-tauri/tauri.conf.json +++ b/apps/readest-app/src-tauri/tauri.conf.json @@ -56,6 +56,9 @@ "section": "text" } }, + "android": { + "minSdkVersion": 26 + }, "fileAssociations": [ { "name": "epub", diff --git a/apps/readest-app/src/app/auth/page.tsx b/apps/readest-app/src/app/auth/page.tsx index 7a533425..f8ceaa6f 100644 --- a/apps/readest-app/src/app/auth/page.tsx +++ b/apps/readest-app/src/app/auth/page.tsx @@ -7,7 +7,6 @@ import { Auth } from '@supabase/auth-ui-react'; import { ThemeSupa } from '@supabase/auth-ui-shared'; import { FcGoogle } from 'react-icons/fc'; import { FaApple } from 'react-icons/fa'; -import { VscAzure } from 'react-icons/vsc'; import { FaGithub } from 'react-icons/fa'; import { IoArrowBack } from 'react-icons/io5'; @@ -21,6 +20,7 @@ import { onOpenUrl } from '@tauri-apps/plugin-deep-link'; import { start, cancel, onUrl, onInvalidUrl } from '@fabianlars/tauri-plugin-oauth'; import { openUrl } from '@tauri-apps/plugin-opener'; import { handleAuthCallback } from '@/helpers/auth'; +import { getOSPlatform } from '@/utils/misc'; type OAuthProvider = 'google' | 'apple' | 'azure' | 'github'; @@ -60,8 +60,9 @@ export default function AuthPage() { const [port, setPort] = useState(null); const isOAuthServerRunning = useRef(false); const [isMounted, setIsMounted] = useState(false); + const osPlatform = getOSPlatform(); - const signIn = async (provider: OAuthProvider) => { + const tauriSignIn = async (provider: OAuthProvider) => { if (!supabase) { throw new Error('No backend connected'); } @@ -72,7 +73,9 @@ export default function AuthPage() { skipBrowserRedirect: true, redirectTo: process.env.NODE_ENV === 'production' - ? 'readest://auth/callback' + ? ['android', 'ios'].includes(osPlatform) + ? 'https://web.readest.com/auth/callback' + : 'readest://auth/callback' : `http://localhost:${port}`, }, }); @@ -200,25 +203,19 @@ export default function AuthPage() {
- @@ -246,7 +243,7 @@ export default function AuthPage() { appearance={{ theme: ThemeSupa }} theme={isDarkMode ? 'dark' : 'light'} magicLink={true} - providers={['google', 'apple', 'azure', 'github']} + providers={['google', 'apple', 'github']} redirectTo='/auth/callback' />