DoSomething / voting-app

☑ Voting app for DoSomething.org campaigns.
MIT License
6 stars 4 forks source link

The "user:admin" Artisan command may make duplicates #523

Closed DFurnes closed 7 years ago

DFurnes commented 8 years ago

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:

  1. Add a unique index on the northstar_id column!
  2. 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.

/cc @katiecrane

DFurnes commented 7 years ago

Closing since we no longer create app-specific admins.