hope you guys are doing well,
I have this User which has a has_many association with an Address model (User has_many addresses). How can I config devise to return all the user addresses at the sign in?
The association already works well, but I cant seem to find a simple solution to this rather than doing another request to get the addresses info from the user, or maybe overriding devise sessions controller. (which I didnt try because I dont know how to exactly do without messing up the default config)
UPDATE: I am using devise token auth to handle the sessions
Solved by implementing the answer found in this issue:https://github.com/lynndylanhurley/devise_token_auth/issues/597#issuecomment-291893591
def token_validation_response
self.as_json(include: :addresses)
end