diff --git a/materialious/android/.idea/.gitignore b/materialious/android/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/materialious/android/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/materialious/android/.idea/compiler.xml b/materialious/android/.idea/compiler.xml new file mode 100644 index 00000000..b589d56e --- /dev/null +++ b/materialious/android/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/materialious/android/.idea/deploymentTargetSelector.xml b/materialious/android/.idea/deploymentTargetSelector.xml new file mode 100644 index 00000000..b268ef36 --- /dev/null +++ b/materialious/android/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/materialious/android/.idea/migrations.xml b/materialious/android/.idea/migrations.xml new file mode 100644 index 00000000..f8051a6f --- /dev/null +++ b/materialious/android/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/materialious/android/.idea/misc.xml b/materialious/android/.idea/misc.xml new file mode 100644 index 00000000..0ad17cbd --- /dev/null +++ b/materialious/android/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/materialious/android/app/capacitor.build.gradle b/materialious/android/app/capacitor.build.gradle index 4a7786f0..e4215d1b 100644 --- a/materialious/android/app/capacitor.build.gradle +++ b/materialious/android/app/capacitor.build.gradle @@ -9,6 +9,7 @@ android { apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" dependencies { + implementation project(':capacitor-app') implementation project(':capacitor-browser') } diff --git a/materialious/android/app/src/main/AndroidManifest.xml b/materialious/android/app/src/main/AndroidManifest.xml index 4d7ca380..084fa47e 100644 --- a/materialious/android/app/src/main/AndroidManifest.xml +++ b/materialious/android/app/src/main/AndroidManifest.xml @@ -22,6 +22,13 @@ + + + + + + + { + const authUrl = new URL(data.url); + const username = authUrl.searchParams.get('username'); + const token = authUrl.searchParams.get('token'); + + if (username && token) { + authStore.set({ + username: username, + token: token + }); + } + }); + async function login() { const path = new URL(`${get(instanceStore)}/authorize_token`); const searchParams = new URLSearchParams({ diff --git a/materialious/src/routes/auth/+page.svelte b/materialious/src/routes/auth/+page.svelte index 01bcb4e6..28141f08 100644 --- a/materialious/src/routes/auth/+page.svelte +++ b/materialious/src/routes/auth/+page.svelte @@ -5,6 +5,7 @@ import { onMount } from 'svelte'; import { authStore } from '../../store'; + // Auth response handling for Desktop onMount(() => { authStore.set({ username: $page.url.searchParams.get('username') as string,