Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(package/appwrite): update appwrite sdk to 15.0.0 #6138

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'releases/august' into feat(package/appwrite)-Update-`Ap…
…pwrite`-SDK-to-`14.0.1`
  • Loading branch information
alicanerdurmaz committed Jul 30, 2024
commit ae3e8caa7867fdd9520497d32d6a0e19744e6f5e
89 changes: 6 additions & 83 deletions examples/data-provider-appwrite/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,89 +21,12 @@ import { App as AntdApp, ConfigProvider } from "antd";
import { appwriteClient, authProvider } from "./utility";

import { PostCreate, PostEdit, PostList, PostShow } from "./pages/posts";

const authProvider: AuthProvider = {
login: async ({ email, password }) => {
try {
await account.createEmailPasswordSession(email, password);
return {
success: true,
redirectTo: "/",
};
} catch (e) {
const { type, message, code } = e as AppwriteException;
return {
success: false,
error: {
message,
name: `${code} - ${type}`,
},
};
}
},
logout: async () => {
try {
await account.deleteSession("current");
} catch (error: any) {
return {
success: false,
error,
};
}

return {
success: true,
redirectTo: "/login",
};
},
onError: async (error) => {
if (error?.code === 401) {
return {
logout: true,
};
}

return { error };
},
check: async () => {
try {
const session = await account.get();

if (session) {
return {
authenticated: true,
};
}
} catch (error: any) {
return {
authenticated: false,
error: error,
logout: true,
redirectTo: "/login",
};
}

return {
authenticated: false,
error: {
message: "Check failed",
name: "Session not found",
},
logout: true,
redirectTo: "/login",
};
},
getPermissions: async () => null,
getIdentity: async () => {
const user = await account.get();

if (user) {
return user;
}

return null;
},
};
import {
CategoryCreate,
CategoryList,
CategoryShow,
CategoryEdit,
} from "./pages/categories";

const App: React.FC = () => {
return (
Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.