Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ログイン/サインイン・ログアウト画面の実装 #10

Merged
merged 2 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fast_api/routers/route_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def login(requset: Request, response: Response,
def logout(requset: Request, response: Response,
csrf_protect: CsrfProtect = Depends()):
csrf_token = csrf_protect.get_csrf_from_headers(requset.headers)
csrf_protect.vtalidate_csrf(csrf_token)
csrf_protect.validate_csrf(csrf_token)
response.set_cookie(
key="access_token",
value="",
Expand Down
9 changes: 6 additions & 3 deletions fast_api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class TodoBase(BaseModel):
title: str
description: str

class Config:
orm_mode = True


class TodoCreate(TodoBase):
pass
Expand All @@ -32,6 +35,9 @@ class SuccessMessage(BaseModel):
class UserBase(BaseModel):
email: str

class Config:
orm_mode = True


class UserCreate(UserBase):
password: str
Expand All @@ -44,9 +50,6 @@ class UserLogin(UserBase):
class User(UserBase):
id: Optional[int]

class Config:
orm_mode = True


class Csrf(BaseModel):
csrf_token: str
202 changes: 202 additions & 0 deletions react_farm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion react_farm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@heroicons/react": "^2.0.16",
"@heroicons/react": "^2.0.17",
"@reduxjs/toolkit": "^1.9.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
Expand Down
Loading