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

Add user mapper that supports users that already exists #17

Open
timonegk opened this issue Feb 5, 2024 · 1 comment
Open

Add user mapper that supports users that already exists #17

timonegk opened this issue Feb 5, 2024 · 1 comment

Comments

@timonegk
Copy link
Member

timonegk commented Feb 5, 2024

This is useful when adding the library to an existing project and existing users have to be mapped. The default user mapper always creates new user objects, potentially violating unique constraints in the database. I have added a user mapper that supports this to two applications (karma and bitpoll):

https://github.com/fsinfuhh/Bitpoll/blob/1e51ef89dcf0647d9b50285ba643ba71641a2cde/bitpoll/base/openid.py#L14-L29

I think this should be integrated with the library.

@lilioid
Copy link
Member

lilioid commented Feb 8, 2024

Yes this might be a good idea. I'm not sure if we want to enable it by default since this has potential security implications that might surprise someone using the library? Maybe we could ship two UserManager implementations: One that creates new user objects and one that updates existing ones. Then a programmer would have to decide which one works better for their usecase.

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

No branches or pull requests

2 participants