-
-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Describe the bug
sub field from userInfo is always undefined
To Reproduce
By using github oauth provider I always get
GET /api/app/oauth/authorization/github 302 in 15ms
[09:09:11] ERROR: Failed query: select count() from "app_user_accounts" where "app_user_accounts"."sub" = ?
params:
err: {
"type": "DrizzleQueryError",
"message": "Failed query: select count() from "app_user_accounts" where "app_user_accounts"."sub" = ?\nparams: : undefined cannot be passed as argument to the database",
"stack":
Error: Failed query: select count(*) from "app_user_accounts" where "app_user_accounts"."sub" = ?
params:
Expected behavior
Setting in oauth2_callback sub as
sub: userInfo.sub ?? userInfo.id?.toString(),
might solve it
Screenshots
looking at the full userInfo object response
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.