Skip to content

Requests and authentication#2

Open
KateF20 wants to merge 6 commits into
masterfrom
requests_and_authentication
Open

Requests and authentication#2
KateF20 wants to merge 6 commits into
masterfrom
requests_and_authentication

Conversation

@KateF20
Copy link
Copy Markdown
Owner

@KateF20 KateF20 commented Jul 3, 2023

No description provided.

KateF20 added 2 commits July 2, 2023 22:10
authentication with JWT
todos and auth separated in 2 routers --> main is an app with both routers included
endpoint names changed in todos.py
Comment thread models.py Outdated
Comment thread todosapp.db
Comment thread routers/admin.py Outdated
Comment thread routers/admin.py Outdated
Comment thread routers/admin.py Outdated
Comment thread routers/auth.py Outdated
Comment thread routers/auth.py
Comment thread routers/todos.py Outdated
Comment thread routers/todos.py Outdated
Comment thread routers/todos.py
Base automatically changed from setup_db to master July 9, 2023 12:07
Comment thread routers/todos.py Outdated
Comment thread dependencies.py Outdated
Comment thread routers/todos.py Outdated
if user is None:
raise HTTPException(status_code=401, detail='Authentication Failed')

todo = db.query(Todo).filter(Todo.id == todo_id).first()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
todo = db.query(Todo).filter(Todo.id == todo_id).first()
todo = get_object_or_404(Todo, Todo.id == todo_id, detail='Todo not found')

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у fastapi нет такого модуля. или ты имел в виду использовать написанный нами тогда собственный?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я предложил тебе написать тебе такой хелпер

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а, поняла. ок

extra filters applied
settings created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants