mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
Add OAuth Reports
This commit is contained in:
6 files changed
+21
-12
No files matched your search
Generated
+4
-4
@@ -7,7 +7,7 @@
|
||||
"name": "@appwrite/console",
|
||||
"dependencies": {
|
||||
"@analytics/google-analytics": "^1.0.5",
|
||||
"@appwrite.io/console": "^0.1.1",
|
||||
"@appwrite.io/console": "github:PineappleIOnic/sdk-for-console#feat-migrations",
|
||||
"@appwrite.io/pink": "^0.0.6-rc.14",
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"@sentry/svelte": "^7.44.2",
|
||||
@@ -158,9 +158,9 @@
|
||||
"integrity": "sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg=="
|
||||
},
|
||||
"node_modules/@appwrite.io/console": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-0.1.1.tgz",
|
||||
"integrity": "sha512-7aBh/8QxKmaMsP9tVJgNsrOBstuikKasSUoSyRNxblK3J/OdPXnQRInZELT9uaK+vqjZaCYspA3B+5UH+DZ9Dw==",
|
||||
"version": "0.1.0",
|
||||
"resolved": "git+ssh://git@github.com/PineappleIOnic/sdk-for-console.git#87ca5652bdc887fd61e4fd7b51dfed6f3163dd03",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"cross-fetch": "3.1.5",
|
||||
"isomorphic-form-data": "2.0.0"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
resourcesToMigrationForm
|
||||
} from '$lib/stores/migration';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { wizard } from '$lib/stores/wizard';
|
||||
|
||||
export let formData: ReturnType<typeof createMigrationFormStore>;
|
||||
export let provider: ReturnType<typeof createMigrationProviderStore>;
|
||||
@@ -100,6 +101,12 @@
|
||||
case 'firebase': {
|
||||
if ($provider.projectId) {
|
||||
// OAuth
|
||||
const res = await sdk.forProject.migrations.getFirebaseReportOAuth(
|
||||
providerResources.firebase,
|
||||
$provider.projectId
|
||||
);
|
||||
|
||||
report = res;
|
||||
} else if ($provider.serviceAccount) {
|
||||
// Manual auth
|
||||
const res = await sdk.forProject.migrations.getFirebaseReport(
|
||||
@@ -139,7 +146,7 @@
|
||||
|
||||
$: resources = providerResources[$provider.provider];
|
||||
|
||||
// $: wizard.setNextDisabled(!report);
|
||||
$: wizard.setNextDisabled(!report);
|
||||
</script>
|
||||
|
||||
<div class="box" style:border-radius="0.5rem">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
const resources = migrationFormToResources($formData);
|
||||
if ($provider.provider !== 'appwrite') return;
|
||||
|
||||
await getSdkForProject($selectedProject).migrations.migrateAppwrite(
|
||||
await getSdkForProject($selectedProject).migrations.createAppwriteMigration(
|
||||
resources,
|
||||
$provider.endpoint,
|
||||
$provider.projectID,
|
||||
|
||||
@@ -135,10 +135,7 @@
|
||||
}))} />
|
||||
</FormList>
|
||||
<p class="u-text-center u-margin-block-start-24">
|
||||
Signed in
|
||||
<button class="u-bold" on:click|preventDefault={deauthorizeGoogle}>
|
||||
Sign Out?
|
||||
</button>
|
||||
<button class="u-bold" on:click|preventDefault={deauthorizeGoogle}>Sign Out</button>
|
||||
</p>
|
||||
{/if}
|
||||
{:else if $provider.provider === 'supabase'}
|
||||
|
||||
@@ -49,9 +49,14 @@
|
||||
break;
|
||||
}
|
||||
case 'firebase': {
|
||||
console.log('firebase', $provider.serviceAccount);
|
||||
if ($provider.projectId) {
|
||||
// OAuth
|
||||
const res = await sdk.forProject.migrations.createFirebaseOAuthMigration(
|
||||
resources,
|
||||
$provider.projectId
|
||||
);
|
||||
|
||||
console.log('Firebase', res);
|
||||
} else if ($provider.serviceAccount) {
|
||||
// Manual auth
|
||||
const res = await sdk.forProject.migrations.createFirebaseMigration(
|
||||
|
||||
@@ -6,7 +6,7 @@ async function getFirebaseProjects() {
|
||||
const res = await sdk.forProject.migrations.listFirebaseProjects();
|
||||
return res.projects;
|
||||
} catch (e) {
|
||||
if (e.code === 401) {
|
||||
if (e.type === 'user_identity_not_found') {
|
||||
return [];
|
||||
} else {
|
||||
throw e;
|
||||
|
||||
Reference in new issue
Block a user