User roles are duplicated when logging in/out
flybot-nam-nguyenhoai opened this issue · 0 comments
flybot-nam-nguyenhoai commented
Problem
When a user logs out and in again, their user roles are duplicated.
Steps to reproduce
- Clone this repository.
- Provide the necessary authentication files:
oauth2.edn
andadmin.edn
(see Configuration files). - Initialize the website for web development (see Front-end dev setup).
- Log in to the website and check
@re-frame.db/app-db
in the ClojureScript REPL.
The user (in:app/user
) should contain roles like these (note the duplicate entries):[#:role{:name :editor, :date-granted #inst "2023-07-24T09:41:00.000-00:00"} #:role{:name :admin, :date-granted #inst "2023-07-24T09:41:00.000-00:00"} #:role{:name :editor, :date-granted #inst "2023-07-24T09:41:00.000-00:00"} #:role{:name :admin, :date-granted #inst "2023-07-24T09:41:00.000-00:00"}]
- Log out and log in again n times, then check
@re-frame.db/app-db
in the ClojureScript REPL.
The user should contain the same roles as above, duplicated exactly 2n more times.
Suggestion
Remove user roles before updating user information during login.