Skip to content

Refactor cache logic#567

Draft
danschultzer wants to merge 1 commit into
mainfrom
refactor-delete-sessions
Draft

Refactor cache logic#567
danschultzer wants to merge 1 commit into
mainfrom
refactor-delete-sessions

Conversation

@danschultzer

@danschultzer danschultzer commented Sep 20, 2020

Copy link
Copy Markdown
Member

Initial work towards a refactor of cache logic

The first step was to move invalidation of existing active sessions to the Pow.Plug.Session module. It doesn't seem right that Pow.Store.CredentialsCache should know about :fingerprint.

Next steps:


Before using erlang match spec, the keys where just binary name spaced values. It was necessary to create three records to pull in all sessions for a user or all users for the sessions. With the match spec I believe that it might be possible to change Pow.Store.CredentialsCache to only use one query to fetch session, sessions for a user, and users for all sessions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete all sessions when calling Pow.Plug.delete_user/2

1 participant