Apply suggestions from code review

Co-authored-by: Torsten Dittmann <torsten.dittmann@googlemail.com>
This commit is contained in:
Vincent (Wen Yu) Ge
2024-03-11 14:20:53 +01:00
committed by GitHub
parent cdb5304ac7
commit 8e54df53fd
26 changed files with 87 additions and 99 deletions

View File

@@ -175,7 +175,6 @@ query {
You can grant permissions to all users using the `Role.users(<STATUS>)` role or You can grant permissions to all users using the `Role.users(<STATUS>)` role or
individual users using the `Role.user(<USER_ID>, <STATUS>)` role. individual users using the `Role.user(<USER_ID>, <STATUS>)` role.
| Description | Role | | Description | Role |
| ------------------------------------------- | ------------------------------------------- | | ------------------------------------------- | ------------------------------------------- |
| Verified users | `Role.users('verified')`| | Verified users | `Role.users('verified')`|

View File

@@ -10,7 +10,7 @@ Anonymous sessions allow you to implement **guest** users. Guest users let you s
# Create anonymous session {% #createSession %} # Create anonymous session {% #createSession %}
Create an anonymous session with [Create Anonymous Session](/docs/references/cloud/client-web/account#createAnonymousSession) route. Create an anonymous session with [Create Anonymous Session](/docs/references/cloud/client-web/account#createAnonymousSession) method.
{% multicode %} {% multicode %}
```js ```js

View File

@@ -1,7 +1,7 @@
--- ---
layout: article layout: article
title: Magic URL login title: Magic URL login
description: Add magic URL to your authentication in Appwrite. Explore the convenience of passwordless login and email-based authentication using magic links." description: Add magic URL to your authentication in Appwrite. Explore the convenience of passwordless login and email-based authentication using magic links.
--- ---
Magic URL is a password-less way to authenticate users. When a user logs in by providing their email, they will receive an email with a "magic" link that contains a secret used to log in the user. The user can simply click the link to be logged in. Magic URL is a password-less way to authenticate users. When a user logs in by providing their email, they will receive an email with a "magic" link that contains a secret used to log in the user. The user can simply click the link to be logged in.

View File

@@ -143,7 +143,6 @@ After creating an OAuth 2 session, you can fetch the session to get information
{% multicode %} {% multicode %}
```js ```js
// Web SDK
import { Client, Account } from "appwrite"; import { Client, Account } from "appwrite";
const client = new Client(); const client = new Client();
@@ -159,7 +158,6 @@ console.log(session.providerAccessToken);
``` ```
```dart ```dart
// Flutter SDK
import 'package:appwrite/appwrite.dart'; import 'package:appwrite/appwrite.dart';
final client = Client() final client = Client()
@@ -179,7 +177,6 @@ print(session.providerAccessToken);
``` ```
```kotlin ```kotlin
// Android SDK
import io.appwrite.Client import io.appwrite.Client
import io.appwrite.services.Account import io.appwrite.services.Account
@@ -200,7 +197,6 @@ print(session.providerAccessToken);
``` ```
```swift ```swift
// Apple SDK
import Appwrite import Appwrite
let client = Client() let client = Client()

View File

@@ -89,7 +89,7 @@ mutation {
# Login {% #login %} # Login {% #login %}
After you've created your account, users can be logged in using the [Create Email Session](/docs/references/cloud/client-web/account#createEmailSession) route. After you've created your account, users can be logged in using the [Create Email Session](/docs/references/cloud/client-web/account#createEmailSession) method.
{% multicode %} {% multicode %}
```js ```js

View File

@@ -191,7 +191,6 @@ val response = teams.createMembership(
You can grant permissions to all members of a team using the `Role.team(<TEAM_ID>)` role or You can grant permissions to all members of a team using the `Role.team(<TEAM_ID>)` role or
individual roles in the team using the `Role.team(<TEAM_ID>, [<ROLE_1>, <ROLE_2>, ...])` role. individual roles in the team using the `Role.team(<TEAM_ID>, [<ROLE_1>, <ROLE_2>, ...])` role.
| Description | Role | | Description | Role |
| ------------------------------------------- | ------------------------------------------- | | ------------------------------------------- | ------------------------------------------- |
| All members | `Role.team(<TEAM_ID>)`| | All members | `Role.team(<TEAM_ID>)`|

View File

@@ -39,13 +39,13 @@
}, },
{ {
title: 'Vue.js', title: 'Vue.js',
icon: 'aw-icon-vue', icon: 'web-icon-vue',
image: '/images/blog/placeholder.png', image: '/images/blog/placeholder.png',
href: 'vue' href: 'vue'
}, },
{ {
title: 'Nuxt', title: 'Nuxt',
icon: 'aw-icon-nuxt', icon: 'web-icon-nuxt',
image: '/images/blog/placeholder.png', image: '/images/blog/placeholder.png',
href: 'nuxt' href: 'nuxt'
}, },
@@ -57,7 +57,7 @@
}, },
{ {
title: 'Refine', title: 'Refine',
icon: 'aw-icon-refine', icon: 'web-icon-refine',
image: '/images/blog/placeholder.png', image: '/images/blog/placeholder.png',
href: 'refine' href: 'refine'
}, },

View File

@@ -130,7 +130,6 @@ async function prepareDatabase(): Promise<void> {
255, false, 255, false,
'This is a test description' 'This is a test description'
); );
await databases.createBooleanAttribute( await databases.createBooleanAttribute(
todoDatabase.$id, todoDatabase.$id,
todoCollection.$id, todoCollection.$id,
@@ -176,7 +175,6 @@ async function seedDatabase(): Promise<void> {
ID.unique(), ID.unique(),
testTodo2 testTodo2
); );
await databases.createDocument( await databases.createDocument(
todoDatabase.$id, todoDatabase.$id,
todoCollection.$id, todoCollection.$id,

View File

@@ -119,7 +119,6 @@ async function prepareDatabase() {
255, false, 255, false,
'This is a test description' 'This is a test description'
); );
await databases.createBooleanAttribute( await databases.createBooleanAttribute(
todoDatabase.$id, todoDatabase.$id,
todoCollection.$id, todoCollection.$id,
@@ -158,14 +157,12 @@ async function seedDatabase() {
sdk.ID.unique(), sdk.ID.unique(),
testTodo1 testTodo1
); );
await databases.createDocument( await databases.createDocument(
todoDatabase.$id, todoDatabase.$id,
todoCollection.$id, todoCollection.$id,
sdk.ID.unique(), sdk.ID.unique(),
testTodo2 testTodo2
); );
await databases.createDocument( await databases.createDocument(
todoDatabase.$id, todoDatabase.$id,
todoCollection.$id, todoCollection.$id,

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/android/step-1'); redirect(303, '/docs/tutorials/android/step-1');
}; };

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/apple/step-1'); redirect(303, '/docs/tutorials/apple/step-1');
}; };

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/flutter/step-1'); redirect(303, '/docs/tutorials/flutter/step-1');
}; };

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/nuxt/step-1'); redirect(303, '/docs/tutorials/nuxt/step-1');
}; };

View File

@@ -103,7 +103,6 @@ const user = useUserSession();
<IdeasList /> <IdeasList />
</div> </div>
</template> </template>
<style> <style>
article.box { article.box {
background-color: hsl(var(--color-neutral-0)); background-color: hsl(var(--color-neutral-0));

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/react/step-1'); redirect(303, '/docs/tutorials/react/step-1');
}; };

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/refine/step-1'); redirect(303, '/docs/tutorials/refine/step-1');
}; };

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/subscriptions-with-stripe/step-1'); redirect(303, '/docs/tutorials/subscriptions-with-stripe/step-1');
}; };

View File

@@ -12,7 +12,7 @@ category: Auth
Appwrite takes away your stress of building and maintaining a backend. Appwrite helps you implement authentication, databases, file storage, and respond to real-time events with **secure** APIs out of the box. Appwrite takes away your stress of building and maintaining a backend. Appwrite helps you implement authentication, databases, file storage, and respond to real-time events with **secure** APIs out of the box.
If you're a Svelte developer, examples in this guide shows you how Appwrite can help you add authentication to Svelte apps faster. If you're a Svelte developer, examples in this guide shows you how Appwrite can help you add authentication to Svelte apps faster.
## Before you start # Before you start {% #before-you-start %}
Even if you've never tried Appwrite, you will get an idea of what it'll feel like to build with Svelte and Appwrite. Even if you've never tried Appwrite, you will get an idea of what it'll feel like to build with Svelte and Appwrite.

View File

@@ -36,14 +36,14 @@ create-svelte version 3.2.0
└ Your project is ready! └ Your project is ready!
``` ```
After the prompt is finished, you can head over to the newly create project. After the prompt is finished, you can head over to the newly created project.
```sh ```sh
cd my-svelte-project cd my-svelte-project
npm install npm install
``` ```
## Adding Appwrite to Your Svelte App # Adding Appwrite to your Svelte app {% #adding-appwrite-to-your-svelte-app %}
Appwrite provides a Web SDK that can be used in your Svelte apps. You can use Appwrite by installing the Web SDK as an NPM package. Appwrite provides a Web SDK that can be used in your Svelte apps. You can use Appwrite by installing the Web SDK as an NPM package.

View File

@@ -38,7 +38,7 @@ export const appwrite = {
For example, your `.env` might look something similar to this. For example, your `.env` might look something similar to this.
```text ```env
PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1 PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
PUBLIC_APPWRITE_PROJECT=642sdddf85b440dc7e5bf PUBLIC_APPWRITE_PROJECT=642sdddf85b440dc7e5bf
``` ```

View File

@@ -6,6 +6,6 @@ step: 7
--- ---
If you want to see these authentication concepts applied in a more robust manner, you can see them in action in this [demo app](https://github.com/appwrite/getting-started-projects/tree/main/svelte/auth). If you want to see these authentication concepts applied in a more robust manner, you can see them in action in this [demo app](https://github.com/appwrite/getting-started-projects/tree/main/svelte/auth).
## Other authentication methods # Other authentication methods {% #other-authentication-methods %}
Appwrite also supports OAuth, passwordless login, anonymous login, and phone login. Appwrite also supports OAuth, passwordless login, anonymous login, and phone login.
Learn more about them in the [authentication guide](https://appwrite.io/docs/products/auth). Learn more about them in the [authentication guide](https://appwrite.io/docs/products/auth).

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/sveltekit/step-1'); redirect(303, '/docs/tutorials/sveltekit/step-1');
}; };

View File

@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types'; import type { PageLoad } from './$types';
export const load: PageLoad = async () => { export const load: PageLoad = async () => {
throw redirect(303, '/docs/tutorials/vue/step-1'); redirect(303, '/docs/tutorials/vue/step-1');
}; };