graphile / starter

Opinionated SaaS quick-start with pre-built user account and organization system for full-stack application development in React, Node.js, GraphQL and PostgreSQL. Powered by PostGraphile, TypeScript, Apollo Client, Graphile Worker, Graphile Migrate, GraphQL Code Generator, Ant Design and Next.js
https://graphile-starter.herokuapp.com
Other
1.73k stars 218 forks source link

fix: make username sanitization case-insensitive (#284) #285

Open hydrandt opened 2 years ago

hydrandt commented 2 years ago

Description

Fixes #284, makes username sanitization case-insensitive to avoid potential conflicts when creating account using oauth providers.

Performance impact

Should be minimal (using lower() 3x in sanitization loop, potentially could be optimized by only running it once and assigning to a variable, is it worth it?

Security impact

None.

Checklist

benjie commented 2 years ago

Is this actually required? Username is citext so it should already be compared case insensitively…

benjie commented 2 years ago

Ah the comparison is text due to concat; we should case the result of concat back to citext.