codeamp / circuit

CodeAmp API. Built with Golang, GraphQL, GORM and Socket-IO
Apache License 2.0
21 stars 6 forks source link

Support upper and lower case strings for postgres username creation #471

Closed drshrey closed 5 years ago

drshrey commented 5 years ago

Currently, when we create a postgres username, we don't encapsulate it around double quotes. This leads to postgres, by default, converting all chars to lower case. However, we should the username output to the codeamp user as upper and lower case chars, so when they try logging in with the user, they get authentication failures.

We can solve this by encapsulating the username in the CREATE USER string with double quotes as mentioned here - https://dev.to/lefebvre/dont-get-bit-by-postgresql-case-sensitivity--457i.