-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): implement JWT-based auth flow for register, login & token…
… management - Configure user registration and login with JWT tokens, set tokens in cookies - Secure API views with IsAuthenticated, enforce permission checks
- Loading branch information
1 parent
61915de
commit 118ae8b
Showing
11 changed files
with
145 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
#serializers.py | ||
# serializers.py | ||
from rest_framework import serializers | ||
from .models import User, Task, Pomodoro | ||
|
||
|
||
class UserSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = User | ||
fields = fields = ('id', 'username', 'email', 'password', 'date_joined', 'birthday', 'profile_picture', 'country') | ||
fields = fields = ( | ||
"id", | ||
"username", | ||
"email", | ||
"password", | ||
"date_joined", | ||
"birthday", | ||
"profile_picture", | ||
"country", | ||
) | ||
|
||
|
||
class TaskSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Task | ||
fields = '__all__' | ||
fields = "__all__" | ||
|
||
|
||
class PomodoroSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = Pomodoro | ||
fields = ['date', 'minutes'] | ||
fields = ["date", "minutes"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ dist | |
dist-ssr | ||
coverage | ||
*.local | ||
|
||
*.env | ||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters