Skip to content

Database call in every API request #487

Description

@arjun289

At present, every time Guardian is used for token verification, a repo call is made to pull out user from the database:
See SnitchApi.Guardian.resource_from_claims/1
This is not required for all the API calls as user data is not required every time.

We can move the loading user data from the database to load user plug.
See SnitchApiWeb.Plug.LoadUser

This plug is already being used specifically in those particular controllers where user data is needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions