mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-09 04:22:13 +00:00
Revert breaking docs changes and add disclaimers for new features until 1.5 on Cloud
This commit is contained in:
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/android/step-1');
|
||||
throw redirect(303, '/docs/tutorials/android/step-1');
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ Add the following to your dependencies in the `app/build.gradle` file:
|
||||
implementation("io.appwrite:sdk-for-android:4.0.1")
|
||||
```
|
||||
|
||||
In case you need to create OAuth2 sessions in the future, the following activity needs to be added inside the `<application>` tag, along side the existing `<activity>` tags in your [AndroidManifest.xml](https://developer.android.com/guide/topics/manifest/manifest-intro).
|
||||
In case you need to create OAuth 2 sessions in the future, the following activity needs to be added inside the `<application>` tag, along side the existing `<activity>` tags in your [AndroidManifest.xml](https://developer.android.com/guide/topics/manifest/manifest-intro).
|
||||
Be sure to replace the **<PROJECT_ID>** string with your actual Appwrite project ID.
|
||||
You can find your Appwrite project ID in you project settings screen in your Appwrite Console.
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class AccountService(client: Client) {
|
||||
|
||||
suspend fun login(email: String, password: String): User<Map<String, Any>>? {
|
||||
return try {
|
||||
account.createEmailPasswordSession(email, password)
|
||||
account.createEmailSession(email, password)
|
||||
getLoggedIn()
|
||||
} catch (e: AppwriteException) {
|
||||
null
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/apple/step-1');
|
||||
throw redirect(303, '/docs/tutorials/apple/step-1');
|
||||
};
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/flutter/step-1');
|
||||
throw redirect(303, '/docs/tutorials/flutter/step-1');
|
||||
};
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/nuxt/step-1');
|
||||
throw redirect(303, '/docs/tutorials/nuxt/step-1');
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ export const useUserSession = () => {
|
||||
};
|
||||
|
||||
const login = async (email: string, password: string): Promise<void> => {
|
||||
const authUser = await account.createEmailPasswordSession(email, password); // Open user session in Appwrite
|
||||
const authUser = await account.createEmailSession(email, password); // Open user session in Appwrite
|
||||
current.value = authUser; // Pass user data to current ref
|
||||
navigateTo("/");
|
||||
};
|
||||
@@ -127,7 +127,7 @@ We will also show buttons to toggle between the two different types of forms.
|
||||
|
||||
# Authentication forms {% #auth-forms %}
|
||||
|
||||
In the previous step, we defined a `AuthForm` to handle signup and login.
|
||||
In the previous step, we defined a `AuthForm` to handle signup and login.
|
||||
Let's build this form now.
|
||||
|
||||
Create a new file `components/authForm.vue` and add the following code.
|
||||
|
||||
@@ -27,7 +27,7 @@ const user = useUserSession();
|
||||
<!-- Email and logout button if logged in user -->
|
||||
<div
|
||||
class="main-header-end u-margin-inline-end-16"
|
||||
v-if="user.current.value"
|
||||
v-if="user.current.value"
|
||||
>
|
||||
<p>{{ user.current.providerUid }}</p>
|
||||
<button class="button" type="button" @click="user.logout()">
|
||||
|
||||
@@ -103,7 +103,7 @@ const user = useUserSession();
|
||||
<IdeasList />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<style>
|
||||
article.box {
|
||||
background-color: hsl(var(--color-neutral-0));
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/react/step-1');
|
||||
throw redirect(303, '/docs/tutorials/react/step-1');
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ export function UserProvider(props) {
|
||||
const [user, setUser] = useState(null);
|
||||
|
||||
async function login(email, password) {
|
||||
const loggedIn = await account.createEmailPasswordSession(email, password);
|
||||
const loggedIn = await account.createEmailSession(email, password);
|
||||
setUser(loggedIn);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/refine/step-1');
|
||||
throw redirect(303, '/docs/tutorials/refine/step-1');
|
||||
};
|
||||
|
||||
@@ -67,7 +67,7 @@ With built-in support for Appwrite in Refine, you only need to pass your Appwrit
|
||||
|
||||
|
||||
{% info title="Note" %}
|
||||
The [@refinedev/appwrite](https://www.npmjs.com/package/@refinedev/appwrite) package supports [Live/Realtime Provider](https://refine.dev/docs/api-reference/core/live-provider/) natively.
|
||||
The [@refinedev/appwrite](https://www.npmjs.com/package/@refinedev/appwrite) package supports [Live/Realtime Provider](https://refine.dev/docs/api-reference/core/providers/live-provider/) natively.
|
||||
{% /info %}
|
||||
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/subscriptions-with-stripe/step-1');
|
||||
throw redirect(303, '/docs/tutorials/subscriptions-with-stripe/step-1');
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export function load() {
|
||||
redirect(303, '/docs/tutorials/sveltekit-csr-auth/step-1');
|
||||
}
|
||||
export const load: PageLoad = async () => {
|
||||
throw redirect(303, '/docs/tutorials/sveltekit-auth/step-1');
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: tutorial
|
||||
title: Client-side authentication with SvelteKit
|
||||
description: Add authentication to a SvelteKit project using Appwrite.
|
||||
title: Authentication with SvelteKit
|
||||
description: Add Authentication to a SvelteKit project using Appwrite.
|
||||
step: 1
|
||||
difficulty: beginner
|
||||
readtime: 20
|
||||
@@ -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.
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: tutorial
|
||||
title: Create project
|
||||
description: Add authentication to a SvelteKit project using Appwrite.
|
||||
description: Add Authentication to a SvelteKit project using Appwrite.
|
||||
step: 2
|
||||
---
|
||||
|
||||
@@ -36,14 +36,14 @@ create-svelte version 3.2.0
|
||||
└ Your project is ready!
|
||||
```
|
||||
|
||||
After the prompt is finished, you can head over to the newly created project.
|
||||
After the prompt is finished, you can head over to the newly create project.
|
||||
|
||||
```sh
|
||||
cd my-svelte-project
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: tutorial
|
||||
title: Initialize SDK
|
||||
description: Add authentication to a SvelteKit project using Appwrite.
|
||||
description: Add Authentication to a SvelteKit project using Appwrite.
|
||||
step: 3
|
||||
---
|
||||
Before you can use Appwrite, you need to instanciate the Appwrite `Client` class with the project ID and endpoint.
|
||||
@@ -38,7 +38,7 @@ export const appwrite = {
|
||||
|
||||
For example, your `.env` might look something similar to this.
|
||||
|
||||
```env
|
||||
```text
|
||||
PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
|
||||
PUBLIC_APPWRITE_PROJECT=642sdddf85b440dc7e5bf
|
||||
```
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: tutorial
|
||||
title: Check if logged in
|
||||
description: Add authentication to a SvelteKit project using Appwrite.
|
||||
description: Add Authentication to a SvelteKit project using Appwrite.
|
||||
step: 4
|
||||
---
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: tutorial
|
||||
title: Create login page
|
||||
description: Add authentication to a SvelteKit project using Appwrite.
|
||||
description: Add Authentication to a SvelteKit project using Appwrite.
|
||||
step: 5
|
||||
---
|
||||
|
||||
@@ -52,7 +52,7 @@ Now we just need to create a form to let the user input sign in data.
|
||||
}
|
||||
|
||||
try {
|
||||
await appwrite.account.createEmailPasswordSession(email, password);
|
||||
await appwrite.account.createEmailSession(email, password);
|
||||
await invalidateAll();
|
||||
} catch (e) {
|
||||
formError = /** @type {import('appwrite').AppwriteException} */ (e).message;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: tutorial
|
||||
title: Create signup page
|
||||
description: Add authentication to a SvelteKit project using Appwrite.
|
||||
description: Add Authentication to a SvelteKit project using Appwrite.
|
||||
step: 6
|
||||
---
|
||||
|
||||
@@ -37,7 +37,7 @@ For signup, you can copy the login `+page.js` and `+page.svelte` files into `src
|
||||
|
||||
try {
|
||||
await appwrite.account.create(ID.unique(), email, password, name);
|
||||
await appwrite.account.createEmailPasswordSession(email, password);
|
||||
await appwrite.account.createEmailSession(email, password);
|
||||
await invalidateAll();
|
||||
} catch (e) {
|
||||
formError = /** @type {import('appwrite').AppwriteException} */ (e).message;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
layout: tutorial
|
||||
title: All set
|
||||
description: Add authentication to a SvelteKit project using Appwrite.
|
||||
description: Add Authentication to a SvelteKit project using Appwrite.
|
||||
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).
|
||||
|
||||
# Other authentication methods {% #other-authentication-methods %}
|
||||
## Other authentication methods
|
||||
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).
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/sveltekit/step-1');
|
||||
throw redirect(303, '/docs/tutorials/sveltekit/step-1');
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ const createUser = () => {
|
||||
|
||||
async function login(email, password) {
|
||||
if (!isBrowser) return;
|
||||
await account.createEmailPasswordSession(email, password);
|
||||
await account.createEmailSession(email, password);
|
||||
await init();
|
||||
goto('/'); // Redirect to home page after login
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async () => {
|
||||
redirect(303, '/docs/tutorials/vue/step-1');
|
||||
throw redirect(303, '/docs/tutorials/vue/step-1');
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ export const user = reactive({
|
||||
await this.login(email, password);
|
||||
},
|
||||
async login(email, password) {
|
||||
await account.createEmailPasswordSession(email, password);
|
||||
await account.createEmailSession(email, password);
|
||||
window.location.href = "/"; // Redirect to home page
|
||||
},
|
||||
async logout() {
|
||||
|
||||
Reference in New Issue
Block a user