If a user has already voted/attempted to log in with a given Northstar ID, the php artisan user:admin command will still create a new Voting App user for that ID and give that user admin privileges. Since we then ask for the first matching local account when logging in, the "duplicate" account that was granted admin privileges is never used.
We should:
Add a unique index on the northstar_id column!
Update the user:admin command to first check if an account with that ID exists, and if so set admin = true on that account, rather than creating a new one.
If a user has already voted/attempted to log in with a given Northstar ID, the
php artisan user:admin
command will still create a new Voting App user for that ID and give that user admin privileges. Since we then ask for the first matching local account when logging in, the "duplicate" account that was granted admin privileges is never used.We should:
northstar_id
column!user:admin
command to first check if an account with that ID exists, and if so setadmin = true
on that account, rather than creating a new one./cc @katiecrane