oauth ligin issues when using multiple auth collections #3700
-
Just encountered an issue with the auth collections which goes away if I delete one, the older collection is the only one able to do oauth login the new one fais with this debug output [20.00ms] SELECT {{_collections}}.* FROM `_collections` WHERE [[id]] = 'scribble_posts' OR LOWER([[name]])='scribble_posts' LIMIT 1
[7.00ms] SELECT COUNT(DISTINCT [[scribble_posts.id]]) FROM `scribble_posts` WHERE [[scribble_posts.title]] LIKE '%%' ESCAPE '\'
[10.00ms] SELECT `scribble_posts`.* FROM `scribble_posts` WHERE [[scribble_posts.title]] LIKE '%%' ESCAPE '\' ORDER BY [[scribble_posts.created]] DESC LIMIT 1
[0.00ms] SELECT {{_collections}}.* FROM `_collections` WHERE [[id]] = 'scribble_user' OR LOWER([[name]])='scribble_user' LIMIT 1
2023/11/07 16:56:09 Realtime connection established: M3R0fZRbeYEYufTXosFwBzfWxaELAiPEEMpGlvAT
[1.00ms] SELECT {{_collections}}.* FROM `_collections` WHERE [[id]] = 'scribble_user' OR LOWER([[name]])='scribble_user' LIMIT 1
[2.00ms] SELECT count(*) FROM `_admins`
[0.00ms] SELECT {{_admins}}.* FROM `_admins` WHERE `id`='ioi8or93u4y9q18' LIMIT 1
[1.00ms] SELECT {{_externalAuths}}.* FROM `_externalAuths` WHERE (NOT (`providerId`='')) AND (`provider`='github' AND `providerId`='72096712') LIMIT 1
[1.00ms] SELECT {{_collections}}.* FROM `_collections` WHERE [[id]] = '51hjtt652zdrck6' OR LOWER([[name]])='51hjtt652zdrck6' LIMIT 1
[0.00ms] SELECT `scribble_user`.* FROM `scribble_user` WHERE `scribble_user`.`id`='cmj55cx7an6m0ld' LIMIT 1
2023/11/07 16:56:18 sql: no rows in result set
2023/11/07 16:56:18 Realtime connection closed (cancelled request): M3R0fZRbeYEYufTXosFwBzfWxaELAiPEEMpGlvAT |
Beta Was this translation helpful? Give feedback.
Answered by
ganigeorgiev
Nov 7, 2023
Replies: 1 comment 3 replies
-
I'm not sure that I understand what actually is the issue. Please provide some context and ideally steps to reproduce. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Removing the collection fixes the issue because it will also delete the users with it.
As mentioned in the above comment, at the moment it is not possible a single OAuth2 user to be used for authentication for multiple users no matter that they are from different collections. I don't exactly remember at the moment why this was done this way (maybe it is something left from before introducing the auth collections). I'll think a little more on it and eventually with the next major version will remove this limitation and update the unique table index to take also the collections in consideration.