Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #386 an Ecto backend store is discussed, and I believe that it should be easier to handle it as association to user. I want to make the stores just pass on the user struct to the backend store instead of doing any transformations on the user.
With this setup, in persistent session store it would be essential to reload the user, so I've added an additional method to
Pow.Operations
that can convert a struct into a get clauses so it can be used inget_by
. Not sure about the name of the method, but the approach feels right.In this case both Ecto and Phoenix modules will rely on
Pow.Operations
as the way to convert back and fourth. I've thought of maybe having just areload
method inPow.Operations
instead, but the get clauses are necessary forPow.Store.CredentialsCache
to construct a key.This PR DRYs up a few things as well. I'll have to give this some more thought, as I'm thinking that I should maybe commit smaller bits of this first.
Resolves #563