This commit is contained in:
Mamalizz
2025-01-14 20:49:36 +03:30
4 changed files with 5 additions and 14 deletions
+2 -2
View File
@@ -200,8 +200,8 @@ REST_FRAMEWORK = {
}
SIMPLE_JWT = {
'ACCESS_TOKEN_LIFETIME': timedelta(days=int(os.getenv("ACCESS_TOKEN_LIFETIME"))),
'REFRESH_TOKEN_LIFETIME': timedelta(days=int(os.getenv("REFRESH_TOKEN_LIFETIME"))),
'ACCESS_TOKEN_LIFETIME': timedelta(minutes=1),
'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
'ROTATE_REFRESH_TOKENS': True,
'BLACKLIST_AFTER_ROTATION': True,
}
+2 -1
View File
@@ -10,7 +10,7 @@ from rest_framework.permissions import IsAuthenticatedOrReadOnly
from utils.pagination import StructurePagination
from drf_spectacular.utils import extend_schema, OpenApiParameter
from drf_spectacular.types import OpenApiTypes
from rest_framework.permissions import AllowAny
class AllCategories(APIView):
serializer_class = CategorySerializer
@@ -21,6 +21,7 @@ class AllCategories(APIView):
class ProductView(APIView):
serializer_class = ProductSerializer
permission_classes = [AllowAny]
def get(self, request, pk):
product = get_object_or_404(ProductModel, id=pk)
product_ser = self.serializer_class(instance=product, many=False)
-10
View File
@@ -1,5 +1,3 @@
import useGetAccount from "~/composables/api/account/useGetAccount";
export const useAuth = () => {
// state
@@ -17,14 +15,6 @@ export const useAuth = () => {
if (reload) window.location.reload();
};
// watch
watch(() => token.value, (newValue) => {
token.value = newValue;
}, {
immediate: true
});
return { token, updateToken, logout };
};
+1 -1
View File
@@ -1,7 +1,7 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2024-11-01",
ssr: false,
ssr: true,
devtools: { enabled: false },
css: ["~/assets/css/tailwind.css", "swiper/css"],