From ec458a0a08a39affffd4dcfaa8772c48a861cda1 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:53:55 -0500 Subject: [PATCH] fix: Security Issues (#3530) Co-authored-by: boc-the-git <3479092+boc-the-git@users.noreply.github.com> --- frontend/lib/api/user/users.ts | 8 +------- frontend/nuxt.config.js | 1 + frontend/pages/user/profile/index.vue | 15 +-------------- mealie/routes/auth/auth.py | 6 ++++++ mealie/routes/users/crud.py | 13 +------------ mealie/schema/user/user.py | 2 +- tests/utils/api_routes/__init__.py | 2 -- 7 files changed, 11 insertions(+), 36 deletions(-) diff --git a/frontend/lib/api/user/users.ts b/frontend/lib/api/user/users.ts index 9da932e8a84..a9dc3c4639a 100644 --- a/frontend/lib/api/user/users.ts +++ b/frontend/lib/api/user/users.ts @@ -1,10 +1,9 @@ import { BaseCRUDAPI } from "../base/base-clients"; import { QueryValue, route } from "~/lib/api/base/route"; -import { PaginationData, RequestResponse } from "~/lib/api/types/non-generated"; +import { PaginationData } from "~/lib/api/types/non-generated"; import { ChangePassword, DeleteTokenResponse, - GroupInDB, LongLiveTokenIn, LongLiveTokenOut, ResetPassword, @@ -30,7 +29,6 @@ const routes = { groupUsers: `${prefix}/users/group-users`, usersSelf: `${prefix}/users/self`, ratingsSelf: `${prefix}/users/self/ratings`, - groupsSelf: `${prefix}/users/self/group`, passwordReset: `${prefix}/users/reset-password`, passwordChange: `${prefix}/users/password`, users: `${prefix}/users`, @@ -57,10 +55,6 @@ export class UserApi extends BaseCRUDAPI { return await this.requests.get>(route(routes.groupUsers, { page, perPage, ...params })); } - async getSelfGroup(): Promise> { - return await this.requests.get(routes.groupsSelf, {}); - } - async addFavorite(id: string, slug: string) { return await this.requests.post(routes.usersIdFavoritesSlug(id, slug), {}); } diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index b27bed70b9c..6954d248d3b 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -156,6 +156,7 @@ export default { propertyName: "access_token", }, refresh: { url: "api/auth/refresh", method: "post" }, + logout: { url: "api/auth/logout", method: "post" }, user: { url: "api/users/self", method: "get" }, }, }, diff --git a/frontend/pages/user/profile/index.vue b/frontend/pages/user/profile/index.vue index 24a4e0f38a2..e7057216622 100644 --- a/frontend/pages/user/profile/index.vue +++ b/frontend/pages/user/profile/index.vue @@ -190,7 +190,6 @@