Skip to content

Authentication class for posts viewset#9

Open
KLaw47 wants to merge 1 commit intomainfrom
fetch_posts_auth
Open

Authentication class for posts viewset#9
KLaw47 wants to merge 1 commit intomainfrom
fetch_posts_auth

Conversation

@KLaw47
Copy link
Collaborator

@KLaw47 KLaw47 commented Feb 28, 2025

Ensures only authenticated users can access/api/posts endpoint
Unauthenticated requests will now receive a 403 Forbidden response.

test
http://127.0.0.1:8000/api/posts

without login:
{
"detail": "Authentication credentials were not provided."
}
with login
response will be whatever posts you have in your local database.

ensure your version of postman has cookies enabled.

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.

3 participants