Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update inviteUser to query using email_lower column instead of email column #542

Closed
jakedemian opened this issue Feb 9, 2022 · 1 comment
Labels
duplicate This issue already exists

Comments

@jakedemian
Copy link
Contributor

jakedemian commented Feb 9, 2022

If a user creates an account with capital letters in their email (eg: [email protected]), and then they are later invited using a different combination of upper/lower case letters (eg: [email protected]), OIDC responds with 500 as it's not realizing the user already exists, and tries to insert an already created user, resulting in:

error: 220208/201916.887, [error] message: insert into "SIP_user" ("app_metadata", "email", "email_lower", "id", "password", "profile") values ($1, $2, $3, $4, $5, $6) returning "id" - duplicate key value violates unique constraint "sip_user_email_lower_unique", stack: error: duplicate key value violates unique constraint "sip_user_email_lower_unique"
    at Connection.parseE (/src/node_modules/pg/lib/connection.js:555:11)
    at Connection.parseMessage (/src/node_modules/pg/lib/connection.js:380:19)
    at Socket.<anonymous> (/src/node_modules/pg/lib/connection.js:120:22)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:601:20)

Updating this block to query based on the email_lower column rather than the email column should resolve this issue.

@zpchavez
Copy link
Contributor

zpchavez commented Feb 9, 2022

This is a duplicate of #499

@zpchavez zpchavez added the duplicate This issue already exists label Feb 9, 2022
@bobeagan bobeagan closed this as completed Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue already exists
Projects
None yet
Development

No branches or pull requests

3 participants