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

Database call in every API request #487

Open
arjun289 opened this issue Nov 12, 2019 · 0 comments
Open

Database call in every API request #487

arjun289 opened this issue Nov 12, 2019 · 0 comments

Comments

@arjun289
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant