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.
At present, every time Guardian is used for token verification, a repo call is made to pull out
userfrom the database:See
SnitchApi.Guardian.resource_from_claims/1This 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.LoadUserThis plug is already being used specifically in those particular controllers where user data is needed.