Skip to content

[API] Change Resource Serializer to Pull user field values from Currently Authed User #67

@BethanyG

Description

@BethanyG

The current resource POST (create) api will take any int value POSTed for the user field. This means, effectively, that one authorized user can "impersonate" another when it comes to creating a resource in the DB.

We don't want this to happen. Instead, the user field should be pulled from and populated by the 'username' field from the JWT token.

See this Stack Overflow Post for information on how this can be accomplished.

see DRF: Generic Views perform_create() under Save and deletion hooks for additional context.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions