Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: remove axios withCredentials

boojack9c842d0a400a
diff --git a/web/src/helpers/api.ts b/web/src/helpers/api.ts
index afaa67787..26ac0a7ee 100644
--- a/web/src/helpers/api.ts
+++ b/web/src/helpers/api.ts
@@ -1,7 +1,5 @@
import axios from "axios";
-axios.defaults.withCredentials = true;
-
type ResponseObject<T> = {
data: T;
error?: string;
@@ -120,12 +118,11 @@ export function getTagList(tagFind?: TagFind) {
}
export async function getRepoStarCount() {
- const data = (
- await axios.get("https://api.github.com/repos/usememos/memos", {
- headers: {
- accept: "application/vnd.github+json",
- },
- })
- ).data;
+ const { data } = await axios.get(`https://api.github.com/repos/usememos/memos`, {
+ headers: {
+ Accept: "application/vnd.github.v3.star+json",
+ Authorization: "",
+ },
+ });
return data.stargazers_count as number;
}