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

fix: attempting to fix the req /session 500 error #419

Merged
merged 2 commits into from
Feb 3, 2024

Conversation

BobDu
Copy link
Member

@BobDu BobDu commented Feb 2, 2024

ref: #418
看起来只有可能是在

const user = await getUserById(userId)

这里 user 为 null 了才能返回这么个错误导致页面跳转 500

再往上看又只能是 在mongo中没有查询到这个userId的情况下才会执行到这么个路径。
但是为什么数据库会查不到就想不明白了。

ping @Kerwin1202
做个判空处理先避免页面500要求重新登录如何?

@BobDu BobDu requested a review from Kerwin1202 February 2, 2024 02:47
@Kerwin1202
Copy link
Member

可以 null 再输出一下 userid 以及 页面传入的 token 呢,看看有啥异常数据

Signed-off-by: BobDu <i@bobdu.cc>
Signed-off-by: BobDu <i@bobdu.cc>
@BobDu
Copy link
Member Author

BobDu commented Feb 2, 2024

可以 null 再输出一下 userid 以及 页面传入的 token 呢,看看有啥异常数据

Done.

@BobDu BobDu merged commit 97951d9 into chatgpt-web-dev:main Feb 3, 2024
2 checks passed
@BobDu BobDu deleted the fix-500 branch February 3, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants