Fix logout flow to use POST

This commit is contained in:
-LAN- 2025-09-27 00:39:35 +08:00
parent c20e0ad90d
commit be13f79696
2 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ class LoginApi(Resource):
@console_ns.route("/logout")
class LogoutApi(Resource):
@setup_required
def get(self):
def post(self):
account = cast(Account, flask_login.current_user)
if isinstance(account, flask_login.AnonymousUserMixin):
return {"result": "success"}

View File

@ -84,8 +84,8 @@ export const updateUserProfile: Fetcher<CommonResponse, { url: string; body: Rec
return post<CommonResponse>(url, { body })
}
export const logout: Fetcher<CommonResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
return get<CommonResponse>(url, params)
export const logout: Fetcher<CommonResponse, { url: string; body?: Record<string, any>; params?: Record<string, any> }> = ({ url, body }) => {
return post<CommonResponse>(url, { body: body ?? {} })
}
export const fetchLangGeniusVersion: Fetcher<LangGeniusVersionResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {