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

bug:v2.8.6社交登录功能无法正常注册用户 #902

Closed
GoodBoyboy666 opened this issue May 29, 2024 · 3 comments
Closed

bug:v2.8.6社交登录功能无法正常注册用户 #902

GoodBoyboy666 opened this issue May 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@GoodBoyboy666
Copy link

问题描述:开启社交登录功能并完善oauth2所需的客户端id与密钥后,登录出现{"msg":"Failed to register user"}

问题排查:经过排查发现为数据库报错导致,具体报错为:Error 1292 (22007): Incorrect datetime value: '0000-00-00' for column 'expires_at' at row 1

问题原因:MySQL 5.7.5之后默认不允许存储此值。

解决方案:通过更改数据库设置

疑问:此值是否为正确的值,是程序获取出错还是人为设置?该值是代表用户登录会话过期时间还是代表用户账户的有效期?

@GoodBoyboy666
Copy link
Author

新增一个bug:使用社交登录出现{"msg":"Failed to register user"},查看日志发现name is required

有以下猜想:
1.用户名来自邮箱注册设置用户名,因为在数据库的auth_identities中仅发现指向用户id的字段。
2.用户名由oauth2请求提供,但由于key的权限设置问题导致没有权限获取用户的用户名。

@GoodBoyboy666
Copy link
Author

问题描述:开启社交登录功能并完善oauth2所需的客户端id与密钥后,登录出现{"msg":"Failed to register user"}

问题排查:经过排查发现为数据库报错导致,具体报错为:Error 1292 (22007): Incorrect datetime value: '0000-00-00' for column 'expires_at' at row 1

问题原因:MySQL 5.7.5之后默认不允许存储此值。

解决方案:通过更改数据库设置

疑问:此值是否为正确的值,是程序获取出错还是人为设置?该值是代表用户登录会话过期时间还是代表用户账户的有效期?

发现通过更改数据库设置仍无法解决,进一步排查应该是时间格式问题

@qwqcode
Copy link
Member

qwqcode commented Jun 9, 2024

感谢反馈和 debug~ 最新版 v2.8.7 已发布,包含这个 MySQL INSERT 语句问题的修复,除此之外我检查补充了一些 OAuth 接口缺失的 scopes,如果实在无法获取用户名将直接从邮箱中提取。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants