diff --git a/backend/authentications/urls.py b/backend/authentications/urls.py
index 75c5914..6029eea 100644
--- a/backend/authentications/urls.py
+++ b/backend/authentications/urls.py
@@ -1,13 +1,11 @@
from django.urls import path
from rest_framework_simplejwt import views as jwt_views
-from authentications.views import ObtainTokenPairWithCustomView, GreetingView, GoogleLogin, GoogleRetrieveUserInfo, CheckAccessTokenAndRefreshToken
+from authentications.views import ObtainTokenPairWithCustomView, GoogleRetrieveUserInfo, CheckAccessTokenAndRefreshToken
urlpatterns = [
path('token/obtain/', jwt_views.TokenObtainPairView.as_view(), name='token_create'),
path('token/refresh/', jwt_views.TokenRefreshView.as_view(), name='token_refresh'),
path('token/custom_obtain/', ObtainTokenPairWithCustomView.as_view(), name='token_create_custom'),
- path('hello/', GreetingView.as_view(), name='hello_world'),
- path('dj-rest-auth/google/', GoogleLogin.as_view(), name="google_login"),
path('auth/google/', GoogleRetrieveUserInfo.as_view()),
path('auth/status/', CheckAccessTokenAndRefreshToken.as_view(), name='check_token_status')
]
\ No newline at end of file
diff --git a/backend/authentications/views.py b/backend/authentications/views.py
index 167581b..87f662e 100644
--- a/backend/authentications/views.py
+++ b/backend/authentications/views.py
@@ -7,17 +7,12 @@ from django.conf import settings
from django.contrib.auth.hashers import make_password
from rest_framework import status
-from rest_framework.permissions import IsAuthenticated, AllowAny
+from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework_simplejwt.tokens import RefreshToken
from rest_framework_simplejwt.authentication import JWTAuthentication
-
-from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
-
-from dj_rest_auth.registration.views import SocialLoginView
-
from google_auth_oauthlib.flow import InstalledAppFlow
from authentications.access_token_cache import store_token
@@ -69,39 +64,6 @@ class ObtainTokenPairWithCustomView(APIView):
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
-class GreetingView(APIView):
- """
- Hello World View.
- Returns a greeting and user information for authenticated users.
- """
- permission_classes = (IsAuthenticated,)
-
- def get(self, request):
- """
- Retrieve a greeting message and user information.
- """
- user = request.user
- user_info = {
- "username": user.username,
- }
- response_data = {
- "message": "Hello, world!",
- "user_info": user_info,
- }
- return Response(response_data, status=status.HTTP_200_OK)
-
-
-class GoogleLogin(SocialLoginView):
- """
- Google Login View.
- Handles Google OAuth2 authentication.
- """
- # permission_classes = (AllowAny,)
- adapter_class = GoogleOAuth2Adapter
- # client_class = OAuth2Client
- # callback_url = 'http://localhost:8000/accounts/google/login/callback/'
-
-
class GoogleRetrieveUserInfo(APIView):
"""
Retrieve user information from Google and create a user if not exists.
diff --git a/backend/users/migrations/0005_alter_userstats_endurance_and_more.py b/backend/users/migrations/0005_alter_userstats_endurance_and_more.py
index 35fe6f7..76ec5c3 100644
--- a/backend/users/migrations/0005_alter_userstats_endurance_and_more.py
+++ b/backend/users/migrations/0005_alter_userstats_endurance_and_more.py
@@ -25,7 +25,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='userstats',
name='luck',
- field=models.IntegerField(default=users.models.random_luck, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(50)]),
+ field=models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(50)]),
),
migrations.AlterField(
model_name='userstats',
diff --git a/backend/users/models.py b/backend/users/models.py
index 7a765a6..2fe1df6 100644
--- a/backend/users/models.py
+++ b/backend/users/models.py
@@ -31,14 +31,12 @@ class CustomUser(AbstractBaseUser, PermissionsMixin):
# Fields for authentication
USERNAME_FIELD = 'email'
- REQUIRED_FIELDS = ['username', 'first_name']
+ REQUIRED_FIELDS = []
def __str__(self):
# String representation of the user
return self.username
-
-def random_luck():
- return random.randint(1, 50)
+
class UserStats(models.Model):
"""
diff --git a/backend/users/views.py b/backend/users/views.py
index af201b7..9d022e3 100644
--- a/backend/users/views.py
+++ b/backend/users/views.py
@@ -7,6 +7,8 @@ from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.parsers import MultiPartParser
+from rest_framework_simplejwt.tokens import RefreshToken
+
from users.serializers import CustomUserSerializer, UpdateProfileSerializer
from users.models import CustomUser
@@ -25,7 +27,9 @@ class CustomUserCreate(APIView):
if serializer.is_valid():
user = serializer.save()
if user:
- return Response(serializer.data, status=status.HTTP_201_CREATED)
+ refresh = RefreshToken.for_user(user)
+ return Response(data={'access_token': str(refresh.access_token), 'refresh_token': str(refresh),},
+ status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs
index 1a8aa39..809eec3 100644
--- a/frontend/.eslintrc.cjs
+++ b/frontend/.eslintrc.cjs
@@ -13,5 +13,6 @@ module.exports = {
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
+ "react/prop-types": 0,
},
};
diff --git a/frontend/package.json b/frontend/package.json
index 70698dc..f057dce 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -31,6 +31,7 @@
"@syncfusion/ej2-base": "^23.1.41",
"@syncfusion/ej2-kanban": "^23.1.36",
"@tremor/react": "^3.11.1",
+ "@wojtekmaj/react-daterange-picker": "^5.4.4",
"axios": "^1.6.1",
"bootstrap": "^5.3.2",
"dotenv": "^16.3.1",
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
index 143df2b..22fdadd 100644
--- a/frontend/pnpm-lock.yaml
+++ b/frontend/pnpm-lock.yaml
@@ -68,6 +68,9 @@ dependencies:
'@tremor/react':
specifier: ^3.11.1
version: 3.11.1(prop-types@15.8.1)(react-dom@18.2.0)(react@18.2.0)(tailwindcss@3.3.5)
+ '@wojtekmaj/react-daterange-picker':
+ specifier: ^5.4.4
+ version: 5.4.4(@types/react-dom@18.2.15)(@types/react@18.2.37)(react-dom@18.2.0)(react@18.2.0)
axios:
specifier: ^1.6.1
version: 1.6.2
@@ -1554,6 +1557,29 @@ packages:
resolution: {integrity: sha512-+i7+JmNiE/3c9FKxzWFi2IjRJ+KzZl1QPu6QNrsgaa2MuBgXvUy4gA1TVzf/JMdIIloB76xSKikTWuyYAIVLww==}
dev: false
+ /@wojtekmaj/react-daterange-picker@5.4.4(@types/react-dom@18.2.15)(@types/react@18.2.37)(react-dom@18.2.0)(react@18.2.0):
+ resolution: {integrity: sha512-EoHFD2SHG1ZeBfdQ9NYaO9MzcdKXy8gikxxFlO3f7HJ/tOGI6/Vxt752sgNnCGsF4JlqVoWVHweyxYOExumRdA==}
+ peerDependencies:
+ '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ dependencies:
+ '@types/react': 18.2.37
+ clsx: 2.0.0
+ make-event-props: 1.6.2
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-calendar: 4.6.1(@types/react@18.2.37)(react-dom@18.2.0)(react@18.2.0)
+ react-date-picker: 10.5.2(@types/react-dom@18.2.15)(@types/react@18.2.37)(react-dom@18.2.0)(react@18.2.0)
+ react-dom: 18.2.0(react@18.2.0)
+ react-fit: 1.7.1(@types/react-dom@18.2.15)(@types/react@18.2.37)(react-dom@18.2.0)(react@18.2.0)
+ transitivePeerDependencies:
+ - '@types/react-dom'
+ dev: false
+
/acorn-jsx@5.3.2(acorn@8.11.2):
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 1ab242f..a917ca5 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -1,21 +1,19 @@
-import { useEffect } from "react";
import "./App.css";
-import { Route, Routes, Navigate } from "react-router-dom";
import axios from "axios";
-import TestAuth from "./components/testAuth";
-import LoginPage from "./components/authentication/LoginPage";
-import SignUpPage from "./components/authentication/SignUpPage";
-import NavBar from "./components/navigations/Navbar";
-import Calendar from "./components/calendar/calendar";
-import KanbanPage from "./components/kanbanBoard/kanbanPage";
-import IconSideNav from "./components/navigations/IconSideNav";
-import Eisenhower from "./components/EisenhowerMatrix/Eisenhower";
-import PrivateRoute from "./PrivateRoute";
-import ProfileUpdatePage from "./components/profilePage";
-import Dashboard from "./components/dashboard/dashboard";
+import { useEffect } from "react";
+import { Route, Routes, Navigate } from "react-router-dom";
+import { LoginPage } from "./components/authentication/LoginPage";
+import { SignUp } from "./components/authentication/SignUpPage";
+import { NavBar } from "./components/navigations/Navbar";
+import { Calendar } from "./components/calendar/calendar";
+import { KanbanPage } from "./components/kanbanBoard/kanbanPage";
+import { SideNav } from "./components/navigations/IconSideNav";
+import { Eisenhower } from "./components/EisenhowerMatrix/Eisenhower";
+import { PrivateRoute } from "./PrivateRoute";
+import { ProfileUpdatePage } from "./components/profile/profilePage";
+import { Dashboard } from "./components/dashboard/dashboard";
import { LandingPage } from "./components/landingPage/LandingPage";
-import PublicRoute from "./PublicRoute";
-
+import { PublicRoute } from "./PublicRoute";
import { useAuth } from "./hooks/AuthHooks";
const baseURL = import.meta.env.VITE_BASE_URL;
@@ -48,9 +46,7 @@ const App = () => {
setIsAuthenticated(false);
}
})
- .catch((error) => {
- console.error("Error checking login status:", error.message);
- });
+ .catch((error) => {});
};
checkLoginStatus();
@@ -70,7 +66,7 @@ const NonAuthenticatedComponents = () => {
{title}
@@ -45,13 +46,13 @@ function TaskDetailModal({ title, description, tags, difficulty, challenge, impo- Lorem ipsum dolor sit amet consectetur adipisicing elit. Odio incidunt nam itaque sed eius modi error - totam sit illum. Voluptas doloribus asperiores quaerat aperiam. Quidem harum omnis beatae ipsum soluta! -
-Unleash productivity with our personal task and project management.
+